surf plot- Z must be a matrix, not a scalar or vector.

1 回表示 (過去 30 日間)
SEPIDEH
SEPIDEH 2015 年 1 月 9 日
回答済み: bob Esmailpour 2019 年 6 月 5 日
Hi all,
I have an excel file with three columns as x,y and z. I want to do "surf" plot I write the mesh grid command , but after writing surf, I am confronting with this error: using surf, Z must be a matrix, not a scalar or vector.
Could you kindly tell me where is the problem?
Thanks in advance for the help Sepideh

回答 (2 件)

Alessandro Masullo
Alessandro Masullo 2015 年 1 月 9 日
The surf function requires the z values to be a matrix. If you have column data you can use trisurf, instead:
tri = delaunay(x,y);
trisurf(tri,x,y,z)

bob Esmailpour
bob Esmailpour 2019 年 6 月 5 日
I found another problem with triSurf. After couple a minute my Matlab was closed without any error. I tried many times but results were same. I have Corei7 PC desktop with 16GB Ram and the size of each matrix is 9197337

カテゴリ

Help Center および File ExchangeAnnotations についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by