MATLAB: Add x and y Values to z data from excel file

cartesianmatrixscalar point map

I have a 37×20 array in excel which corresponds to the magnitude of z value at each point. I would like to add the following x and y values to create a 3D matrix.
x=linspace(0,100,20)
y=linspace(0,28,37)
The resulting matrix would have coordinates of element 1 (0,0,(Value from z array))
Any help is greaty appreciated

Best Answer

It looks as though that would do exactly what you want.
For example, this:
z = rand(37,20); % Use Your ‘z’ Matrix Here
x=linspace(0,100,20);
y=linspace(0,28,37);
figure
surf(x, y, z)
grid on
xlabel('x')
ylabel('y')
zlabel('z')
will plot it appropriately.