How to plot a 3D surface from a non square matrix?
2 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Lin Yang
am 7 Dez. 2018
Kommentiert: madhan ravi
am 10 Dez. 2018
Hi, I am a newbee in matlab and have some difficulty to plot a surface from matrix. Here is the problem, I have a
matrix (
) and a
vector and a
vector. I want to plot a surface from the matrix with the two vectors as X and Y axis, respectively. Bu it is impossible to directly use the function 'surf' since
. Does anyone know what should I do to generate the plot? Thanks a lot in advance.
0 Kommentare
Akzeptierte Antwort
madhan ravi
am 7 Dez. 2018
Bearbeitet: madhan ravi
am 10 Dez. 2018
Try the below example and adapt it to your needs:
x=1:10;
y=1:9;
z=rand(numel(x),numel(y));
[X,Y]=meshgrid(x,y); %redundant
surf(X,Y,z')
2 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Surface and Mesh Plots finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!