surf plot: Z must be a matrix, not a scalar or vector
Show older comments
Hi guys,
I am having the error as titled. My problem is a bit different from the others. I have a matrix Res = 33x201x181 which was generated from 3 different parameters. A = 1x33, B = 1x201 and C = 1x181. I want to do a surface plot like
surf(B,C,Res(1,:,:))
But it kept coming with the error of Z must be a matrix. I don't really understand why Res(1,:,:) wasn't recognize as matrix. Thank you for you help.
1 Comment
KSSV
on 14 Jul 2017
Show us the calculations of Res.....
Answers (1)
Walter Roberson
on 14 Jul 2017
surf(B, C, squeeze(Res(1,:,:)))
Categories
Find more on Surface and Mesh 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!