设置图片大小

Set size of image

我创建了一个图像,它是 MATLAB 中 imagesc 函数的输出。

我的问题:如何将转置矩阵的较大图像和较小的常规图显示为子图?

我已经为自己尝试了以下代码,但没有走多远。我正在寻找对我所做的事情的评论以及我可以用来实现最终目标的建议。

figure(1);
hFig = figure(1);
set(hFig, 'Position', [100 100 500 500]);
subplot(2,1,1)
imagesc(normalized_matrix'),colormap(jet)
ax = gca;
ax.XLimMode = 'manual';
ax.XLim = [0e4 30e4];
ax.XTickLabelMode = 'manual';
ax.XTickLabel = {'0', '5', '10', '15', '20', '25', '30'};
xlabel('Time in Seconds')

subplot(2,1,2)
plot(force_resample)
ax1 = gca;
ax1.XLimMode = 'manual';
ax1.XLim = [0e4 30e4];
ax1.XTickLabelMode = 'manual';
ax1.XTickLabel = {''};
ax1.YLimMode = 'manual';
ax1.YLim = [0 2];
ylabel('Force in Newtons')
ax1.XLimMode = 'manual';
ax1.XLim = [0e4 30e4];
ax1.XTickLabelMode = 'manual';
ax1.XTickLabel = {'0', '5', '10', '15', '20', '25', '30'};
xlabel('Time in Seconds')

将子图网格的更多部分分配给图像。例如:

%Sample Data
normalized_matrix = [1:10; 11:20; 21:30; 31:40];
force_resample = rand(4,40);

subplot(3,1,1:2);   %using 2/3 part of the grid for the image
imagesc(normalized_matrix); 

subplot(3,1,3);     %using remaining 1/3 part of the grid for plot
plot(force_resample);

给出: