【发布时间】:2019-05-06 03:21:33
【问题描述】:
我在 matlab 上画一个格子。我想要格子的特定线条 使颜色与我在程序中其他地方计算的矩阵的值相对应
for ix=1:Lx; for iy=1:Ly;
xs=ix;ys=iy;
if ix<Lx;
%nnn along x
line([xs xs+1],[ys ys],'LineWidth',0.0000001,'LineStyle','--','Color','r'); hold on;
%nnn along y
if iy==1; line([xs+1/2 xs+1/2],[ys ys+1/2],'LineWidth',0.0000001,'LineStyle','--','Color','r'); hold on; end;
if iy>=2 ; line([xs+1/2 xs+1/2],[ys-1/2 ys+1/2],'LineWidth',0.0000001,'LineStyle','--','Color','r'); hold on; end;
end;
等等。
如何根据我在别处计算的 2d 矩阵 D2mat(Lx,Ly) 的值更改颜色(上述 sn-p 中的红色)和线条宽度(如果可能)?
谢谢,
M
【问题讨论】: