MATLAB程序中有无hold on为什么会出现不同结果图?clear all;clc;% hold onc1=load('c1.txt');x=c1(:,3);y=c1(:,4);z=c1(:,5);for i=1:length(c1)if c1(i,2)==1scatter3(x(i),y(i),z(i),25,'w.');elsescatter3(x(i),y(i),z(i),20,'b.');endendhold onfor

来源:学生作业帮助网 编辑:作业帮 时间:2024/05/04 04:35:41
MATLAB程序中有无hold on为什么会出现不同结果图?clear all;clc;% hold onc1=load('c1.txt');x=c1(:,3);y=c1(:,4);z=c1(:,5);for i=1:length(c1)if c1(i,2)==1scatter3(x(i),y(i),z(i),25,'w.');elsescatter3(x(i),y(i),z(i),20,'b.');endendhold onfor

MATLAB程序中有无hold on为什么会出现不同结果图?clear all;clc;% hold onc1=load('c1.txt');x=c1(:,3);y=c1(:,4);z=c1(:,5);for i=1:length(c1)if c1(i,2)==1scatter3(x(i),y(i),z(i),25,'w.');elsescatter3(x(i),y(i),z(i),20,'b.');endendhold onfor
MATLAB程序中有无hold on为什么会出现不同结果图?
clear all;
clc;
% hold on
c1=load('c1.txt');
x=c1(:,3);
y=c1(:,4);
z=c1(:,5);
for i=1:length(c1)
if c1(i,2)==1
scatter3(x(i),y(i),z(i),25,'w.');
else
scatter3(x(i),y(i),z(i),20,'b.');
end
end
hold on
for j=2:length(c1)
for i=1:length(c1)
if c1(j,7)==c1(i,1)
if c1(j,7)==1
plot3([x(i) x(j)],[y(i) y(j)],[z(i) z(j)],'w','linewidth',2);
break;
else
plot3([x(i) x(j)],[y(i) y(j)],[z(i) z(j)],'b','linewidth',1.5);
break;
end
end
end
end
colordef black
title('附录B 1')
程序第三行如果有hold on那么运行后图形为二维图像,如果没有则为三维图像,这是为什么呢?

MATLAB程序中有无hold on为什么会出现不同结果图?clear all;clc;% hold onc1=load('c1.txt');x=c1(:,3);y=c1(:,4);z=c1(:,5);for i=1:length(c1)if c1(i,2)==1scatter3(x(i),y(i),z(i),25,'w.');elsescatter3(x(i),y(i),z(i),20,'b.');endendhold onfor
hold on是指再画新图时保留老的图像.
hold off是指在画新图时覆盖老的图像.
Matlab默认是hold off.
不对啊,第一个hold on应该是无关的才对啊.
你把两个hold on都换成figure;再试试?

matlab中什么时候需要使用hold on matlab 中hold on与hold off是不是成对出现 MATLAB程序中有无hold on为什么会出现不同结果图?clear all;clc;% hold onc1=load('c1.txt');x=c1(:,3);y=c1(:,4);z=c1(:,5);for i=1:length(c1)if c1(i,2)==1scatter3(x(i),y(i),z(i),25,'w.');elsescatter3(x(i),y(i),z(i),20,'b.');endendhold onfor matlab中 hold matlab如何将循环的信号存入循环的变量名a(i)中,不可覆盖.for i=1:50x=1:1:650;X=length(x);yi=power(0.97+i/5000,x);axis([1,650,-1,1]);plot(yi);end我想通过这段程序得到50个长度为650的指数函数,不要用hold on,那样 matlab中legend标注都是同一颜色,不随图像线型变化在同一坐标系内画两个图,程序分别如下:plot(1000*h,1000*V1,'.b');hold on;.D=qingxie(:,2);E=qingxie(:,1);plot(1000*D,1000*E,'-r+');hold on;然后标注:legend('有变位 我用matlab画图怎么不能在一张图里画两段曲线啊?程序:fplot('(5*pi*sin((pi*k)/90))/18',[0,90]); hold on ezplot('0',[90,180]); hold on ezplot('-(5*pi*sin((pi*k)/90))/18',[180,270]); hold on ezplot('0',[270,360]); hold off Matlab中的hold on 怎么不起作用了啊?程序如下:>> fplot('(x-0.005-0.21*exp(25/44))*(1.47-0.269*exp(25/85))',[0,2,0,2.5],'-')>>hold on>>fplot('(x-0.005-0.21*exp(35/44))*(1.47-0.269*exp(35/85))',[0,2,0,2.5],'+')>>hold on>>fplot('(x-0.005-0 matlab中画波特图的某程序的一些疑问b=[0.4914];a=[1,0.9884,1.2386,0.4914];[h w]=freqs(b,a);phaiw=angle(h);subplot(211);plot(w,abs(h) ,'-k','linewidth',0.5,'markersize',3);hold on;xlabel('角频率(rad)');ylabel('幅度');title('幅频响 matlab中三维制图程序错哪里了all;t=-2:0.1:2;[x,y]=meshgrid(t,t);z=-(x.^2+y.^2)+250;surf(x,y,z)xlabel('x');ylabel('y');zlabel('z');hold on;t1=-2:0.001:2;h=plot3(t1,zeros(1,length(t1)),-t1.^2+250,'LineWidth',3);legend(h,'要旋转的曲线'); matlab简单问题,在一个窗口中画出两个图形程序如下:fplot('sin(x)',[-pi,pi],'r-')hold on,fplot('x*tan(1./x).*sin(x.^3)',[pi,4*pi],'y-')为什么运行的时候只有第二个公式的图像?怎么修改才能同时出现两个图像 所有欧美歌曲中歌词中有come on now,hold you,hold you,hold you 的 matlab中 clf hold off命令的区别是什么? hold on matlab 如何修改?for t=0:0.005:1expmat=expm3(A*t);Xt=expmat*x0; %Xt=expmat*x0+(expmat-onediag)*ABK;hold on;plot(t,Xt(1),'x',t,Xt(2),'*',t,Xt(3),'o',t,Xt(4),'-',t,Xt(5),'+',t,Xt(6),'-.');axis([0 -10; 1 10])hold on;grid onend上面程序运行后 matlab 用subplot和hold on 以后是这个效果,试验程序运行出来是个效果:clear all;n=20;a=(round(100*rand(n,1))/100)*2.2-0.9;figure;hold on;subplot(2,2,1);plot(1:n,a,'rx');xlabel('样本数');ylabel('生化化验 matlab 用subplot和hold on 以后无法把绘图放在一个窗口里,试验程序运行出来是个效果:clear all;n=20;a=(round(100*rand(n,1))/100)*2.2-0.9;figure;hold on;subplot(2,2,1);plot(1:n,a,'rx');xlabel('样本数');ylabe matlab中box on、box