matlab自定义颜色代码,自定义颜色为matlab表面图
生活随笔
收集整理的這篇文章主要介紹了
matlab自定义颜色代码,自定义颜色为matlab表面图
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
你可以玩colormap和沖浪的第四個輸入.
以下情節
由…產生
[X,Y,Z] = peaks(1000);
%colormap
cmap = [0.6 0.2 0.4;
0.5 0.5 0.5;
0.1 0.9 0.9];
Zcolor = zeros(size(Z));
threshold = 2;
Zcolor(Z <= -threshold) = 1; % first row of cmap
Zcolor(Z > -threshold & Z < threshold) = 2; % second row of cmap
Zcolor(Z >= threshold) = 3; % third row of cmap
figure('Color','w');
surf(X, Y, Z, Zcolor, 'EdgeColor', 'None');
colormap(cmap);
light('Position', [0 -2 1])
總結
以上是生活随笔為你收集整理的matlab自定义颜色代码,自定义颜色为matlab表面图的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: [Leetcode][第题][JAVA]
- 下一篇: 关于递归函数,非递归函数中引用传参的问题