Assigning colors on a cylinder
21 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Dave
am 4 Okt. 2014
Beantwortet: Image Analyst
am 4 Okt. 2014
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 Kommentare
Akzeptierte Antwort
Matz Johansson Bergström
am 4 Okt. 2014
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.
0 Kommentare
Weitere Antworten (1)
Image Analyst
am 4 Okt. 2014
Did you look in the help at the cylinder() function? It shows lots of cylinders with color sides.
0 Kommentare
Siehe auch
Kategorien
Mehr zu Surface and Mesh Plots finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!