如何在 MATLAB 中合并 "tiledLayout" 创建的图块?

How to merge tiles created by "tiledLayout" in MATLAB?

在 MATLAB 中使用 subplot 时,我可以合并来自不同子图的轴以创建更大的子图,例如:

x = 1:10;
figure
subplot(131)
plot(x)
subplot(1,3,2:3)
plot(x+2)

现在 MATLAB 引入了 tiledlayout,我正在使用它而不是 subplot,因为它允许用户修改图形中各个轴之间的间隙。但我不知道如何合并不同的图块来创建更大的图块。有什么方法可以组合 tiledlayout 创建的不同图块来创建更大的图块(基本上,我正在寻找 subplot(1,3,2:3) 的等价物)?

看看 nexttile and the various ways to call it. Take for example the documentation of nexttile(span) 上面写着:

Tile span, specified as a vector of the form [r c], where r and c are positive whole numbers. Use this argument to make the axes span r rows by c columns of tiles in the layout.

演示如下: