How can i plot this pic by matlab ??

1 回表示 (過去 30 日間)
Sarah
Sarah 2013 年 12 月 10 日
回答済み: DGM 2025 年 4 月 6 日

回答 (1 件)

DGM
DGM 2025 年 4 月 6 日
It looks like an upside-down representation of HSV with some random unknown extra line. I'm going to ignore it, since it looks like a mistake.
% vertex colors
CT0 = [0 0 0; % k
1 1 1; % w
hsv(6)]; % rygcbm
% vertex locations
a = 0.5;
b = sqrt(3)/2;
V = [0 0 1; % k
0 0 0; % w
1 0 0; % r
a b 0; % y
-a b 0; % g
-1 0 0; % c
-a -b 0; % b
a -b 0]; % m
% face list
ps = (3:8).';
F = [2*ones(6,1) circshift(ps,-1) ps;
ones(6,1) ps circshift(ps,-1)];
% plot it all
patch('faces',F,'vertices',V, ...
'facevertexcdata',CT0,'facecolor','interp');
view(-62,-22)
axis equal; grid on
xlabel('X'); ylabel('Y'); zlabel('Z')
ylim([-1 1])

カテゴリ

Help Center および File ExchangeSurface and Mesh Plots についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by