x1 = linspace(0,20,100);
y1 = sin(x1);
x2 = 3:17;
y2 = rand(1,15);
% Create plots.
t = tiledlayout(2,1);
ax1 = nexttile;
plot(ax1,x1,y1)
ax2 = nexttile;
stem(ax2,x2,y2)
% Link the axes. Add title and labels.
linkaxes([ax1,ax2],'x');
t を関数 xlabel および関数 ylabel に渡して、共有の x 軸と y 軸のラベルを作成します。関数 xticklabels を呼び出して、一番目のプロットから x 軸の目盛ラベルを削除します。次に、t の TileSpacing プロパティを 'compact' に設定して、プロットの間隔を最小にします。
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.