how to plot surface graph in matlab?
2 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Deepesh Kumar Gupta
le 9 Avr 2022
Commenté : Deepesh Kumar Gupta
le 11 Avr 2022
I have 41 values of temperature starting from 350,351,352,353...........,390 and 30 values of radius starting from 0.001, 0.002, 0.003......,upto 0.03.Now from 41 values of temperature and 30 values of radius , i obtained 41*30 =1230 values of PPDF. Now i have to plot surface graph between Temperature (let's on x co-ordinate ), radius (let's on y co-ordinate) and PPDF (on z co-ordinate ). How can i plot surface graph ? please help me with the code. Here i am attaching my code which is giving me error.
% x co-ordinate data
temp1=350:1:390;
temp=temp1';
% y co-ordinate data
rad1=.001:.001:.03;
rad=rad1';
% z co-ordinate data
% for this i have attached csv file.
% here 'temp_rad_graph _data.csv is the file which consist x ,y and z coordinate data
test=csvread('temp_rad_graph_data.csv');
x=test(:,1);
y=test(:,2);
z=test(:,3);
h=scatter3(x,y,z,'filled','MarkerEdgeColor','flat')
colormap jet
0 commentaires
Réponse acceptée
Scott MacKenzie
le 9 Avr 2022
Modifié(e) : Scott MacKenzie
le 9 Avr 2022
The surf function is probably what you want: (Note that csvread is "not recommended".)
x = 350:390;
y = linspace(0.001, 0.03, 30);
z = readmatrix('https://www.mathworks.com/matlabcentral/answers/uploaded_files/958230/PPDF.csv');
z = reshape(z, numel(y),[]);
surf(x, y, z, 'FaceColor', [.7 .8 .9]);
xlabel('Temperature');
ylabel('Radius');
zlabel('PPDF');
3 commentaires
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Delaunay Triangulation dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!