Flatten a (x,y,z,data) surface and save as a matrix
조회 수: 7 (최근 30일)
이전 댓글 표시
I am calculting spherical harmonics projected on an oblate spheroid via surf(x,y,z,data) - example output like:
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/329144/image.png)
I would like to save a matrix that is the flattened version of this via some set perspective (the plot below is constructed from the above plot with the view(90,0) command included):
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/329147/image.png)
While this output gives the exact appearance that I am looking for, I do not know how to save this data into another matrix.
I imagine some loop that cuts through a section each itteration and saves the values into a blank matrix, however, I was wondering
if there was a built in function or some better way to go about this... Thank you!
댓글 수: 5
Walter Roberson
2020년 7월 11일
For each x y z combination is there x y -z exactly? or is it x y z and approximately x approximately y approximately -z?
Is the view needed only viewing from above on the z towards negative z or are arbitrary other angles required?
Are x and y strictly rectangular equal spaced, or is it only x that is equal spaced and y is not equal spaced in linear coordinates (e.g. might be linear spaced in a different coordinate system)? For that matter is the original coordinate system equal spaced in polar coordinates rather than rectangular?
Note that equal spaced in linear coordinates implies nan in the data so it is probably not what you used.
These questions have to do with figuring out which coordinates are on "top" to be able to reject the coordinates "underneath" when creating the image.
답변 (1개)
Prabhan Purwar
2020년 7월 13일
Hi,
Could you please provide some more insights, for better response
Although from my initial understanding, the following links may be useful
- https://www.mathworks.com/matlabcentral/fileexchange/69262-spherical-harmonics (Spherical Harmonics using MATLAB)
- https://www.mathworks.com/help/matlab/ref/viewmtx.html (Transformation matrix using viewmtx)
Hope it helps!!
댓글 수: 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!