Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/matlab/14.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Matlab 两个图中y轴方向上的相同单位_Matlab_Equals_Axes - Fatal编程技术网

Matlab 两个图中y轴方向上的相同单位

Matlab 两个图中y轴方向上的相同单位,matlab,equals,axes,Matlab,Equals,Axes,假设: x=1:10; y=x.^2; h(1)=subplot(3,1,1:2); plot(x,y); h(2)=subplot(3,1,3); plot(x,y); 我想知道是否有办法在两个图的y轴方向上使用相同的数据单元,例如缩短上图的y轴,使其与下图的y轴相等 提前非常感谢你, Werner正如Dev iL已经指出的那样。示例代码可以是 x=1:10; y=x.^2;%First Output z=x.^1.5;%Another output figure h(1)=subpl

假设:

x=1:10;
y=x.^2;

h(1)=subplot(3,1,1:2);
plot(x,y);

h(2)=subplot(3,1,3);
plot(x,y);
我想知道是否有办法在两个图的y轴方向上使用相同的数据单元,例如缩短上图的y轴,使其与下图的y轴相等

提前非常感谢你,
Werner

正如Dev iL已经指出的那样。示例代码可以是

x=1:10;
y=x.^2;%First Output
z=x.^1.5;%Another output

figure
h(1)=subplot(2,1,1);
plot(x,y);
grid 'on'

h(2)=subplot(2,1,2);
plot(x,z);
grid 'on'

linkaxes([h(2) h(1)],'y');
看见