필터 지우기
필터 지우기

How to use fillup3 to color shape?

조회 수: 1 (최근 30일)
Ragini Ravichandren
Ragini Ravichandren 2019년 9월 23일
댓글: darova 2019년 9월 24일
How do you use the fillup3 function to make a shape? I am able to make the flat shape using the plot3 command, but the fillup3 just produces just a black line. I read that you were supposed to use the fourth argument to specify color so I just put y for yellow.
p=[11,10,16]
q=[11,10,18]
r=[15,9,18]
M=[p;q];
fill3(M(:,1), M(:,2), M(:,3), y);
figure(2);
hold on;
G=[p;r];
fill3(G(:,1), G(:,2), G(:,3), y);
hold on;
L=[q;r];
fill3(L(:,1), L(:,2), L(:,3), y);
  댓글 수: 2
KALYAN ACHARJYA
KALYAN ACHARJYA 2019년 9월 23일
Undefined function or variable 'y'??
Ragini Ravichandren
Ragini Ravichandren 2019년 9월 23일
Sorry, are you asking what variable y is?

댓글을 달려면 로그인하십시오.

채택된 답변

darova
darova 2019년 9월 23일
One aproach
p=[11,10,16];
q=[11,10,18];
r=[15,9,18];
M=[p;q;p;r;q;r];
i = randi(6,1,6); % mix indices
cm = jet(6); % create 6 colors
f1 = fill3(M(:,1), M(:,2), M(:,3), 'y');
set(f1,'FaceVertexCData',cm(i,:),...
'edgecolor','interp',...
'marker','*')
  댓글 수: 4
Ragini Ravichandren
Ragini Ravichandren 2019년 9월 24일
Got it, though there seems to be some kind of error, saying the expression is invalid. Am I missing any spaces or anything?
darova
darova 2019년 9월 24일
image.jpg

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Surface and Mesh Plots에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by