千家信息网

【MATLAB】画图使用调色板实现自动线条颜色的方法

发表于:2025-12-02 作者:千家信息网编辑
千家信息网最后更新 2025年12月02日,n=10; %n types of colors in hsv;cc=hsv(n);figure;hold on;for i=1:12plot(result(1,:), 'color', cc(mod
千家信息网最后更新 2025年12月02日【MATLAB】画图使用调色板实现自动线条颜色的方法

n=10; %n types of colors in hsv;

cc=hsv(n);

figure;

hold on;

for i=1:12

plot(result(1,:), 'color', cc(mod(i,n)+1, :)); %mod(i,n) is to prevent color from exceeding hsv dimensions, +1 because hsv(0) has no definition;

end


0