Assigning colors on a cylinder

23 views (last 30 days)
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 Comments
Guillaume
Guillaume on 4 Oct 2014
What exactly is your question? How to draw that thing? something else?
Dave
Dave on 4 Oct 2014
Edited: Dave on 4 Oct 2014
Yes. Drawing a 3D cylinder with colors represent real values.

Sign in to comment.

Accepted Answer

Matz Johansson Bergström
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.

More Answers (1)

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

Community Treasure Hunt

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

Start Hunting!