Getting x and y arrays of surf(z)

조회 수: 2 (최근 30일)
Rafael Madrid
Rafael Madrid 2014년 10월 8일
댓글: Rafael Madrid 2014년 10월 8일
Hi,
This might be a hard to explain question; I have an intensity array that I use to get a surf(Z) of a hemisphere. Is there a way to get the equivalent x and y arrays of these intensities, ie, if I were to surf(x,y,z) of these 3 I would get the same result? Maybe a different way of asking would be, can I split surf(Z) into surf(x,y,z) and get the same result. Because I need to have these x and y arrays also to compare my hemisphere to a matlab generated sphere. Thanks.
Raf

채택된 답변

Guillaume
Guillaume 2014년 10월 8일
If you've just generated your surface with
surf(z)
Then
[x, y] = meshgrid(1:size(z, 2), 1:size(z, 1));
  댓글 수: 1
Rafael Madrid
Rafael Madrid 2014년 10월 8일
Perfect. It was so obvious, I can't believe I missed it. thank you/

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Surface and Mesh Plots에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by