2D plot of 3D data

Hi there,
I'm not sure how best to go about making a 2D plot of my 3D data. I have calculated FFT of samples at points in the x,y and z axes but I would like to use surf() to plot this information as a 2D surface plot in spherical coordinates theta and phi, how best can I go about this??
Many thanks in advance Bran

 채택된 답변

José-Luis
José-Luis 2013년 1월 14일

0 개 추천

Maybe slice() is what you are looking for?

댓글 수: 4

Bran
Bran 2013년 1월 15일
This is a very good answer, however, due to the type of information I have it is not quite suitable. I have instead decided to make my own slices and to use surf() plot however, I was going to ask you if you knew how to find values of my function at specific z values. SO for example I have calculated my function A (which is a function of x, y and z) and now I want to pick out values at several specific z values. How can I do that as I have alot of data?? Many many thanks in advance jose! :)
José-Luis
José-Luis 2013년 1월 15일
편집: José-Luis 2013년 1월 15일
No worries.
If the values of z actually exist in your data, then you can use logical indexing or find().
log_idx = z==some_value;
your_x = x(log_idx); %etc
If you want to interpolate, then you could use the interp2() built-in function.
Bran
Bran 2013년 1월 15일
AHHH yes of course! I remember now! THANK YOU! :)
Bran
Bran 2013년 1월 16일
Hey jose, so sorry to be bothering you again, but I am trying to indeed use the slice function for my data as it seems to be the only way to display volume information; I have x = [-7:1:9] y = [-7:1:9] z = [-7:1:9]
v = FFT and I wish to take several slices across the z acces ie; zslice = [0, 5, 9]
but the command slice(x,y,z,v,xslice,yslice,zslice)
is throwing up several errors any idea what might be wrong??
Many thanks :)

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

추가 답변 (0개)

카테고리

질문:

2013년 1월 14일

Community Treasure Hunt

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

Start Hunting!

Translated by