ploting or showing a 41*41*50 matrixt

hello every one
I have a 41*41*50 matrix that shows geometry of one location that each number shows a specific geometry like old alluvial, new alluvial or special soil like incepti soil and so on, i want to plot this 3D matrix and if possible same number with the same colour. i want to check my gemetries and for doing that plotting need to done. i will send the matrix to show the matrix for better understanding my points of view and sooner help. Is there any one to show me the way? Thank you so much in advance.

 Accepted Answer

if it is in a grid
[x,y]=meshgrid(1:41);
surf(x,y,satur(:,:,1));%shows the first one

4 Comments

hello thanks for your answer, in the case of i want to all 50 z layer together what should i do?
It seems like you should do 50 different plots, if you put them all together it would be a mess.
[x,y]=meshgrid(1:41);
for k=1:50;
figure;
surf(x,y,satur(:,:,k));
end
thank you but maybe it couldnt be seen in the way i want because i want to see inside of the 41*41*50 box and see different parts in detail that is not possible. by the way i appreciate your good tips and thank you so much for your good answer.
You can blow up any portion of the plots, they are interactive.

Sign in to comment.

More Answers (1)

Typing "doc plot" will give you documentation on a host of plotting options that MATLAB has. You can use the contour function to look at values along a slice in any dimension, or contour3 to look at the whole thing. Also see the Image Processing Toolbox functions, article "Display and Exploration - Functions", there are a few functions designed to display and look over 3D images.
>> figure, contour(satur(:,:,1))
>> figure, contour3(satur(:,:,1))

3 Comments

thanks a lot for your answer but it sounds i need another map kind than contour to show with more details the different part of my box.
Then try different combinations of index values for your 3D matrix. Using colon by itself means use everything in that dimension. Using a single number means only on index in that dimension, so (:,:,1) means a 2D slice along index 1 of the third dimension. To make that even smaller, (1:20,1:20,1) would be a quarter of a 2D slice along index 1 of the third dimension.
Obviously without more information we do not know what you are looking for in your data set. But these are the basic commands for how to explore it in MATLAB.
Hi Dear Benjamin
Thanks so much for your good tips yes i will try it.

Sign in to comment.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!