help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Waterfall Plot in Octave


From: Jam
Subject: Re: Waterfall Plot in Octave
Date: Tue, 7 Jan 2014 22:11:55 -0800 (PST)

clear all; close all; clc;

T = 30;
n = 512;

t2 = linspace(-T/2, T/2, n+1); t = t2(1:n);
k = (2*pi/T)*[0:n/2-1 -n/2:-1];
ks = fftshift(k);

slice = [0:0.5:10];
[S,T] = meshgrid(slice,t);
[S,K] = meshgrid(slice,k);

U = sech(T-10*sin(S)).*exp(i*0*T);

subplot(2,1,1); pl = plot3(T,S,U); view(-15,70);
for ii=1:21, set(pl(ii),'color','k'); end 
for j = 1:length(slice)
        UT(:,j) = abs(fftshift(fft(U(:,j))));
end
subplot(2,1,2); 
pl=plot3(fftshift(K),S,UT); view(-15,70);
for ii=1:21, set(pl(ii),'color','k'); end 

This octave code draws this 
<http://octave.1599824.n4.nabble.com/file/n4660781/sh2-2.jpg> 




--
View this message in context: 
http://octave.1599824.n4.nabble.com/Waterfall-Plot-in-Octave-tp4652110p4660781.html
Sent from the Octave - General mailing list archive at Nabble.com.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]