Matlab Plotting

neilofbodom

Member
Hi guys

I am trying to plot a surface plot on Matlab. My data points are in an excel file, which is read by the program and stored in respective variables. I have a set of corresponding latitude, longitude and thickness points.

This is what I tried:

filename = 'Data.xlsx';

x = xlsread(filename, 'C:C');
y = xlsread(filename, 'D:D');
z = xlsread(filename, 'E:E');

[X,Y] = meshgrid(x,y);

figure
mesh(X,Y,z);

My question is, how should I rectify the error "Z must be a matrix, not a scalar or vector" please? Also, is the mesh plot tool what you would suggest?

Thanks!
 
Last edited:
Not sure this is a lot of help, but the error is basically saying z is a single value, not a list of values.

What values are you loading into x,y and z?
 
Back
Top