-2

As the title says, I need to specify different colours for the segments composing a cylinder in MatLab.

I built my cylindric structure using this .m file on File Exchange:

http://www.mathworks.com/matlabcentral/fileexchange/21758-cylinder-surface-connecting-2-points/content/cylinder2P.m

since I needed the structure to have different radius for every level.

Now, I have a vector with some values (let's call it x). What I'd like to do is to assign some colours to these values (say, if a value is in a certain range, assign to it colour blue). Then, using the data in x, I'd like to specify for every level of the cylinder the corresponding colour information stored in x.

Hope to have been clear enough.

Any help would be appreciated.

Vittorio
  • 11
  • 3
  • How familiar are you with Matlab? Is there anything you have tried? Do you have ideas on how to implement this in Matlab? Please clarify your question accordingly. Currently, one might get them impression that you are looking to be 'spoon-fed' a solution. – Schorsch Jul 15 '14 at 19:26
  • I am not familiar with 3d structures in Matlab, so I do realize my question seems unclear. I'm trying to implement a for loop that reads the value in the x vector and, according to it, sets the colour of the corresponding cylindric segment. Let's say x(1)=2, and I want 2 to correspond to colour blue, so the first level of the cylinder must be coloured blue. What I lack is the correct way to refer to the cylinder levels. – Vittorio Jul 15 '14 at 19:38

1 Answers1