How to build a 3D matrix?
Show older comments
I have a homework assignment that I just need help understanding. We are to make a 4x6x3 matrix, where each column of the image is a single color, in rainbow order (Red, Orange, Yellow, Green, Blue, Purple), but we must use for loops. I'm not quite sure what I'm doing, but I did write a code.
mat=zeros(4,6,3);
row1=[255,0,0];
row2=[0,255,0];
row3=[0,0,255];
for
img(:,col,1)=mycolormap(col,1);
img(:,col,2)=mycolormap(col,2);
img(:,col,3)=mycolormap(col,3);
end
please help me out. I'm new to Matlab and I'm little confused.
2 Comments
John BG
on 28 Sep 2016
you mean a volume, you want to build a volume?
Sarah Sadeq
on 29 Sep 2016
Accepted Answer
More Answers (0)
Categories
Find more on Color Segmentation in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!