How to reshape 'Z' matrix for surf(X,Y,Z)
조회 수: 11 (최근 30일)
이전 댓글 표시
Hi. I am fairly new to MATLAB and I am trying to use surf to plot 3D surface plot for my modal curvature. i have meshed the grid and my X and Y matrices are of size 2000X2000. I want to reshape my 'Z' Matrix so that it becomes of size 2000X2000 from 2000X4.
Where 2000 is the number of elements in my beam and 4 is the vertices of those elements
Edit-Thank you guys for response but i have tried reshape(Z,2000,2000) before asking here. It is not working. Also I am using AEM based modelling so there are no nodes but the springs used for elements connections.
댓글 수: 1
Stephen23
2023년 7월 11일
"Where 2000 is the number of elements in my beam and 4 is the vertices of those elements"
That sounds like you should use PATCH, rather than MESH:
답변 (1개)
Divyam
2023년 7월 11일
You can use the reshape function.
updatedZ = reshape(Z', 2000, 2000);
More information about the reshape function: Reshape array - MATLAB reshape - MathWorks India
댓글 수: 1
Stephen23
2023년 7월 11일
"You can use the reshape function."
No, you cannot use RESHAPE to change an array with 8000 elements into an array with 4000000 elements.
참고 항목
카테고리
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!