X Y Z Surface Plot Problem
Show older comments
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
Accepted Answer
More Answers (2)
Bora Tek
on 20 Apr 2012
0 votes
1 Comment
Matt Tearle
on 23 Apr 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
on 29 Apr 2012
1 Comment
Matt Tearle
on 30 Apr 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.
Categories
Find more on Line Plots in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!