plot surface 3d from table

5 visualizaciones (últimos 30 días)
mohamdi mohamed
mohamdi mohamed el 22 de Sept. de 2023
Comentada: Dyuman Joshi el 22 de Sept. de 2023
hi everyone
i have this table
0.04 0.06 0.08 0.1 0.12 0.15
20 1112 1239 1349 1432 1505 1629
16 1003 1115 1195 1264 1322 1415
10 836.3 917.3 978.6 1035 1075 1145
8 782.7 840.1 904 954 996 1056
7 734.9 804.1 864.1 911.7 949.8 1015
5 836.3 721 772.4 815.1 859.5 922.4
i want the same plot in matlab
surface 3d
can some one help me

Respuesta aceptada

Dyuman Joshi
Dyuman Joshi el 22 de Sept. de 2023
Import the data, assign the first column as x data, top row as y data (or vice-versa, depending upon how you define the axis) and the remaining matrix as the z data, and then use surf.
%That would look like
x = [20 16 10 8 7 5];
y = [0.04 0.06 0.08 0.1 0.12 0.15];
z = [1112 1239 1349 1432 1505 1629;
1003 1115 1195 1264 1322 1415;
36.3 917.3 978.6 1035 1075 1145;
782.7 840.1 904 954 996 1056;
734.9 804.1 864.1 911.7 949.8 1015;
836.3 721 772.4 815.1 859.5 922.4 ];
surf(x,y,z)
set(gca,'XDir','reverse', 'YDir', 'reverse')
view([45 45])
  2 comentarios
mohamdi mohamed
mohamdi mohamed el 22 de Sept. de 2023
thank you Sir
Dyuman Joshi
Dyuman Joshi el 22 de Sept. de 2023
You are welcome!

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre 2-D and 3-D Plots en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by