请问matlab中如何将两个figure放在一起

问题描述:

请问matlab中如何将两个figure放在一起
figure(1);
x=-4:0.5:4;
y=x
[X,Y]=meshgrid(x,y);
Z=X.^2+Y.^2;
subplot(211)
mesh(Z)
h=mesh(Z)
figure(2);
m=-4:0.5:4;
n=m
[M,N]=meshgrid(m,n);
A=M.^2+N.^2;
subplot(211)
mesh(A)
h=mesh(A)
set(h,'facecolor','m','edgecolor',[1 1 1],'marker','o','markeredgecolor','b')
hold on;
每次加载后都是两个figure没有办法把他们平起来
还有如何插入文字》
我希望能在第一个figure中插入三维网格图
第二个figure中插入三维曲线图
1个回答 分类:综合 2014-10-07

问题解答:

我来补答
figure(1);
x=-4:0.5:4;
y=x
[X,Y]=meshgrid(x,y);
Z=X.^2+Y.^2;
subplot(211)
mesh(Z)
h=mesh(Z)
% figure(2);
m=-4:0.5:4;
n=m
[M,N]=meshgrid(m,n);
A=M.^2+N.^2;
subplot(212)
mesh(A)
h=mesh(A)
set(h,'facecolor','m','edgecolor',[1 1 1],'marker','o','markeredgecolor','b')
hold on;
再问: 如果是希望它是两个横着的而不是竖着的怎么办?
再答: subplot换下就好了 subplot(121) subplot(122)
 
 
展开全文阅读
剩余:2000
上一页:例2的第一问