From: omegayen on 26 Jul 2010 16:13 I am not sure how to properly do this. I have several Fourier Transform 2d plots that I want to be able to show in 3D with essentially just the 2d plots stacked on top of each other. Now what I have done thus far is take Fourier Transforms of some data I have in MATLAB and I have created a 262143 x 20 matrix, where each column represents a different Fourier Transform. Now to plot this data in 2D space I would do NValues=(1:262143)'; figure, plot(NValues,FTransform(:,1)); So in 3D I was thinking to do X=ones(262143,20); for ii=1:20 X(:,ii)=NValues; end and then this part I was not sure about Y=0:3.814726369677503e-006:1; Y=Y.'; for ii=1:20 Y(:,ii)=Y; end plot3(X,Y,abs(FTransform)) However this does not give me the 3D result of stacking each Fourier Transform as I ended. In this case the 3D plot is just a 2D plane. Can anyone help me understand what to do thanks.
From: Ross on 26 Jul 2010 19:41 "omegayen " <omegayen(a)ameritech.net> wrote in message <i2kq8v$iru$1(a)fred.mathworks.com>... > I am not sure how to properly do this. > > I have several Fourier Transform 2d plots that I want to be able to show in 3D with essentially just the 2d plots stacked on top of each other. > > Now what I have done thus far is take Fourier Transforms of some data I have in MATLAB and I have created a 262143 x 20 matrix, where each column represents a different Fourier Transform. > > Now to plot this data in 2D space I would do > > NValues=(1:262143)'; > figure, plot(NValues,FTransform(:,1)); > > So in 3D I was thinking to do > > X=ones(262143,20); > for ii=1:20 > X(:,ii)=NValues; > end > > and then this part I was not sure about > > Y=0:3.814726369677503e-006:1; > Y=Y.'; > for ii=1:20 > Y(:,ii)=Y; > end > plot3(X,Y,abs(FTransform)) > > However this does not give me the 3D result of stacking each Fourier Transform as I ended. In this case the 3D plot is just a 2D plane. Can anyone help me understand what to do thanks. You need to arrange things so X has constant columns, but Y has constant rows (or perhaps vice versa): this is referred to in the Matlab help as "2-D plaid". The easiest way to do this is to use meshgrid to construct X and Y. so xx needs to contain numbers 1 to 20 and yy needs to contain 0:3.814726369677503e-006:1 (or vice versa) [X,Y]=meshgrid(xx,yy); plot3(X,Y,F)
From: omegayen on 27 Jul 2010 12:59 "Ross " <rosswoodskiwi(a)hotmail.com> wrote in message <i2l6ek$ij2$1(a)fred.mathworks.com>... > "omegayen " <omegayen(a)ameritech.net> wrote in message <i2kq8v$iru$1(a)fred.mathworks.com>... > > I am not sure how to properly do this. > > > > I have several Fourier Transform 2d plots that I want to be able to show in 3D with essentially just the 2d plots stacked on top of each other. > > > > Now what I have done thus far is take Fourier Transforms of some data I have in MATLAB and I have created a 262143 x 20 matrix, where each column represents a different Fourier Transform. > > > > Now to plot this data in 2D space I would do > > > > NValues=(1:262143)'; > > figure, plot(NValues,FTransform(:,1)); > > > > So in 3D I was thinking to do > > > > X=ones(262143,20); > > for ii=1:20 > > X(:,ii)=NValues; > > end > > > > and then this part I was not sure about > > > > Y=0:3.814726369677503e-006:1; > > Y=Y.'; > > for ii=1:20 > > Y(:,ii)=Y; > > end > > plot3(X,Y,abs(FTransform)) > > > > However this does not give me the 3D result of stacking each Fourier Transform as I ended. In this case the 3D plot is just a 2D plane. Can anyone help me understand what to do thanks. > > You need to arrange things so X has constant columns, but Y has constant rows (or perhaps vice versa): this is referred to in the Matlab help as "2-D plaid". The easiest way to do this is to use meshgrid to construct X and Y. > > so xx needs to contain numbers 1 to 20 and yy needs to contain 0:3.814726369677503e-006:1 (or vice versa) > > [X,Y]=meshgrid(xx,yy); > plot3(X,Y,F) great that helps. thanks!
|
Pages: 1 Prev: remember pushbutton state of internal GUI Next: Simulink AWGN+LMS Equalizer |