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 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