I am trying to build a series of 2D matrices containing those and zeros (effectively black and white images) in MATLAB that are ordered in 3D.
The code I have so far is:
function PlotthreeD()
numrows = 100;
numcols = 100;
Plot1 = zeros(numcols);
Plot1(20:50,20:50) = 1;
Plot2 = zeros(numcols);
Plot1(20:70,20:90) = 1;
Plot3 = zeros(numcols);
Plot3(20:50,20:50) = 1;
B = cat(3, Plot1, Plot2, Plot3);
figure;
offset = 100;
hold on;
for i=1:3;
mesh(B(:,:,i)+offset*(i));
end
end
Is there a drawing command (not a grid) that will allow me to display 2D arrays as solid shapes (where the matrix elements are 1), instead of making these areas appear raised (as they are with the grid)
James source
share