PDA

View Full Version : 3D array in MATLAB



blmadhavan
7th May 2010, 09:31 PM
Hi,

I would like to know how can I create a 3D array in MATLAB. I could not succeed after going through various literature available in the search engine.

I have data like this: X = 1x10 matrix,
Y = 7x1 matrix,
Z1 = 7x10 matrix
Z2 = 7x10 matrix
Z3 = 7x10 matrix and so on...

My intention is to read each of the Z elements as a function of (X,Y). Can any one help me in creating and reading the 3D matrix array?

Thanking you,
Madhavan

jgarces
11th May 2010, 06:52 PM
Hi Madhavan,

Example
x =1:10;
y = 1:7;
Z1 = ones(7,10);
Z2 = zeros(7,10);
Z3 = ones(7,10)*2;
z(:,:,1) = Z1;
z(:,:,2) = Z2;
z(:,:,3) = Z3;

Josť

blmadhavan
11th May 2010, 07:00 PM
Thank you for your response.

42d3e78f26a4b20d412==