3D surface plot in matlab
조회 수: 3 (최근 30일)
이전 댓글 표시
Hi friends, How can I plot a 3D surface plot or 3D mesh from this kind of data in matlab. Column1 on X axis, column2 on Y axis and column3 on Z axis.
h = [ 100 100 0.0243 ; 100 310 0.0679 ; 100 350 0.0643 ;
150 200 0.3153 ;
150 250 0.3010 ;
150 450 0.1087 ;
200 180 0.4895 ;
200 400 0.1529 ;
200 450 0.1123 ; ];
I already used plot3() command but get discretely plotted values, not a surface plot or mesh.
Thanks, Yusuf
댓글 수: 0
답변 (2개)
Sean de Wolski
2012년 2월 22일
You could feed the unique values of the first two columns into meshgrid() to get a uniform grid, then with reshaping the third column accordingly you can use mesh() or surf().
댓글 수: 0
Patrick Kalita
2012년 2월 22일
Check out the answers to these very similar question:
- http://www.mathworks.com/matlabcentral/answers/220-3d-plot-from-imported-excel-data
- http://www.mathworks.com/matlabcentral/answers/4006-creating-a-3d-surface-plot
- http://www.mathworks.com/matlabcentral/answers/14002-3d-surface-plot-with-only-vectors
Also, this File Exchange submission is an example of what you are trying to do:
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Surface and Mesh Plots에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!