在Matlab中重新缩放图像中的X轴

时间:2018-02-11 00:03:07

标签: matlab matlab-figure

我在Matlab中编写了以下代码,以显示不同颜色的红色。如何将子图中的所有x轴重新缩放到0-1?

% create a custome color map
map = zeros(11,3);
reds = 0:0.1:1;
map(:,1) = reds(:);
colormap(map);

figure(1)

depth = [1 2 3 4];
num_depth = length(depth);

for index = 1: num_depth    
    subplot(num_depth,1,index);
    step = 1/(2^depth(index)-1);
    A = 0:step:1;
    imagesc(A);
    axis equal
    set(gca,'ytick',[])
end

enter image description here

1 个答案:

答案 0 :(得分:2)

但是,ERROR in Error: Child compilation failed: Entry module not found: Error: Can't resolve '/src/index.html' 可以指定图像位置。使用imagesc(x,y,C)x指定与yC(1,1)对应的角落的位置。

C(m,n)

输出是:

enter image description here