X Y Z coordinates 1 matrix

Hi!
I'm a beginer who uses MATLAB
I want to have only 1 matrix, where each element of the matriz will be a (x,y,z) point. How can i do that?
N=200;
rL=1;
h=0.05;
clx=0.05;
x = linspace(-rL,rL,N);
y = linspace(-rL,rL,N);
[X,Y] = meshgrid(x,y);
Z = h.*randn(N,N);
F = exp(-((X.^2+Y.^2)/(clx^2/2)));
f = 2/sqrt(pi)*rL/N/clx*ifft2(fft2(Z).*fft2(F));
surf(X,Y,f,'FaceColor','interp',...
'EdgeColor','none',...
'FaceLighting','phong')
axis equal off

1 Comment

So the result should be a N^3 x 3 -matrix ?

Sign in to comment.

Answers (0)

Asked:

on 14 Mar 2022

Commented:

on 14 Mar 2022

Community Treasure Hunt

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

Start Hunting!