Hi. I've plotted 27 cubes with this code: https://www.mathworks.com/matlabcentral/fileexchange/15161-plotcube
for i=1:size(b,1) plotcube([1 1 1],b(i,1:3),1,[1 0 0]); end for i=1:size(c,1) plotcube([1 1 1],c(i,1:3),1,[0 1 0]); end for i=1:size(d,1) plotcube([1 1 1],d(i,1:3),1,[0 0 1]); end
and the b,c and d matrices are shown below:
b =[2 2 3 3 2 3 4 2 3 2 3 3 3 3 3 4 3 3 2 4 3 3 4 3 4 4 3]; c =[2 2 4 3 2 4 4 2 4 2 3 4 3 3 4 4 3 4 2 4 4 3 4 4 4 4 4]; d =[2 2 5 3 2 5 4 2 5 2 3 5 3 3 5 4 3 5 2 4 5 3 4 5 4 4 5];
At the end I want to add legend to the plotted cubes based on their colors. How can I do that? Thanks a lot.
Best Answer