octave-maintainers
[Top][All Lists]
Advanced

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

request to run spectrogram example code in Matlab


From: John W. Eaton
Subject: request to run spectrogram example code in Matlab
Date: Thu, 4 Oct 2018 12:20:18 -0400
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1

I'm working on the spectrogram function and can't seem to get the same plots as shown in the Matlab online documentation for this function.

Could someone run the following in a recent version of Matlab and post the resulting sgram.mat file? This is the first example from the Matlab online documentation for spectrogram. Also, please verify that the figure you generate looks the same as the one there.

N = 1024;
n = 0:N-1;
w0 = 2*pi/5;
x = sin(w0*n)+10*sin(2*w0*n);
s = spectrogram (x);
spectrogram (x, 'yaxis');
%% For the following, I expect one image object as the
%% child of the axes object.  If that's not correct, then
%% can you find the image that is plotted and get the cdata,
%% xlim, and ylim values?
h = get (gca, 'children');
cdata = get (h, 'cdata');
xlim = get (h, 'xlim');
ylim = get (h, 'ylim');
cmap = colormap ();
save sgram.mat x s cdata xlim ylim cmap


Thanks,

jwe



reply via email to

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