首先说声谢谢,
高手能帮我编个完整的程序吗?谢谢,急用
A=round(rand(10)*4);
for i=0:1:9;
if i<=9
for j=0:1:9
if j<=9
switch A(i+1,j+1)
case {0}
rectangle('position',[i,j,1,1],'LineWidth',3);
case {1}
rectangle('position',[i,j,1,1],'LineWidth',3,'Facecolor','r');
case {2}
rectangle('position',[i,j,1,1],'LineWidth',3,'Facecolor','y');
case {3}
rectangle('position',[i,j,1,1],'LineWidth',3,'Facecolor','b');
case {4}
rectangle('position',[i,j,1,1],'LineWidth',3,'Facecolor','g');
otherwise
disp('Unknown parameter.');
end
end
end
end
end
您好,就是这样的数据和图,我需要用不同的软件来做表格和图。现在就差matlab软件做了。如果可以的话,请编个程序。写个论文纠结坏了。谢谢高手!
追答只能画成这样了。
追问嗯,对,我就需要这样的结果。能把具体程序发给我吗?谢谢您!这个是用一个还是两个程序?
追答u2=[9.253 8.151 4.077 2.046 1.025 0.819 0.613 0.408 0.204 0];
il=[1.867 2.055 2.055 2.055 2.055 2.055 2.055 2.055 2.054 2.053];
x=[1 2 3 4 5 6 7 8 9 10]./10;
subplot(2,1,2);
plot(u2,il);
subplot(2,1,1);
axis off;
text(0,0.6,'u2');
text(0,0.4,'il');
for i=1:length(u2)
str1=num2str(u2(i));
str2=num2str(il(i));
text(x(i),0.6,str1);
text(x(i),0.4,str2);
end