Assigning colors on a cylinder

조회 수: 21 (최근 30일)
Dave
Dave 2014년 10월 4일
답변: Image Analyst 2014년 10월 4일
Hi,
Assume a cylindrical surface is divided into horizontal and vertical (equal) segments. I need to assign colors to each square area according to some known values (e.g. each color represents a real number vary between 0.1 and 3)
Any suggestion would be appreciated.
Dave
  댓글 수: 2
Guillaume
Guillaume 2014년 10월 4일
What exactly is your question? How to draw that thing? something else?
Dave
Dave 2014년 10월 4일
편집: Dave 2014년 10월 4일
Yes. Drawing a 3D cylinder with colors represent real values.

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

채택된 답변

Matz Johansson Bergström
Matz Johansson Bergström 2014년 10월 4일
Simplest way
[x,y,z] = cylinder;
surface(x,y,z, 'FaceColor','texturemap',...
'EdgeColor','none','Cdata', rand(10))
Gives random coloring to the cylinder. Another approach would be to supply a texture to the cylinder and wrap it with it.

추가 답변 (1개)

Image Analyst
Image Analyst 2014년 10월 4일
Did you look in the help at the cylinder() function? It shows lots of cylinders with color sides.

카테고리

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