dazhangyu
2011-03-06, 15:54
代码如下:
xPic=a;yPic=b; %a,b是实数,可能是正,也可能是负
plot(xPic,yPic,'pr','markersize',8,'MarkerFaceColor','r');%画点
str_ls=['(',num2str(xPic),',',num2str(yPic),')'];%点坐标字符串
text(xPic,yPic,str_ls);%%在图上标出点的坐标
问题:
每次必须重启MATLAB r2008, 否则报错:
??? Subscript indices must either be real positive integers or logicals.
为什么呢?
xPic=a;yPic=b; %a,b是实数,可能是正,也可能是负
plot(xPic,yPic,'pr','markersize',8,'MarkerFaceColor','r');%画点
str_ls=['(',num2str(xPic),',',num2str(yPic),')'];%点坐标字符串
text(xPic,yPic,str_ls);%%在图上标出点的坐标
问题:
每次必须重启MATLAB r2008, 否则报错:
??? Subscript indices must either be real positive integers or logicals.
为什么呢?