X Y Z Surface Plot Problem
3 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Hello Friends,
I need your assistance about plotting x y z axis surface graphic
I have tunnel data on excel; Tunnel lenght, Temperature, Time
I want to show these datas on matlab
here is my datas
Thank you so much
0 commentaires
Réponse acceptée
Matt Tearle
le 20 Avr 2012
data = xlsread('filename.xlsx'); % read in everything (numeric)
t = data(1,2:end); % first row (except first element)
l = data(2:end,1); % first column (except first element)
temp = data(2:end,2:end); % actual data in the table
surf(t,l,temp) % make surface plot
2 commentaires
Matt Tearle
le 20 Avr 2012
Welcome. No problem, we all start somewhere :)
http://www.mathworks.com/matlabcentral/answers/8026-best-way-s-to-master-matlab
Plus de réponses (2)
Bora Tek
le 20 Avr 2012
1 commentaire
Matt Tearle
le 23 Avr 2012
You mean exchange the x and y axes? Yes, just transpose your data matrix:
temp = data(2:end,2:end)';
surf(l,t,temp)
Bora Tek
le 29 Avr 2012
1 commentaire
Matt Tearle
le 30 Avr 2012
Note the transpose operator (') at the end of the command temp = data(2:end...
temp is a matrix with m rows and n columns. When making a surface plot, the m rows are taken to be the values at m y locations; the n columns are taken to be the values at n x locations. So when you do surf(x,y,temp), the x vector should have n elements, and y should have m elements. To switch x and y, you need to flip (transpose) the matrix *and* the x and y vectors in the surf command.
Voir également
Catégories
En savoir plus sur 2-D and 3-D Plots 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!