wscalogram and subplots

Hi.
I'm trying to make a subplot containing a scalogram, original signal and a spectrogram.
The problem is that MATLAB ignores the scalogram and just doesn't show it. The original signal obtained in the top using wscalogram should not be showed, only the scalogram and another original signal made by some other commands. So how to do that?
subplot(3,1,1); the plot of the original signal
subplot(3,1,2); wscalogram('image',c,'scales',scales,'ydata',signal,'xdata', t)
subplot(3,1,3); the plot of the spectrogram
So I want the ydata to be gone but the xdata should still be shown on the x-axis for the scalogram, and when I delete ydata, xdata has no influence.
I hope you can help!
-Trine

Réponses (1)

Wayne King
Wayne King le 29 Fév 2012

2 votes

Hi Trine, Call wscalogram() with the first input just ' ' and return an output, which you can plot as an image. For example:
wname = 'mexh';
scales = (1:128);
load cuspamax
signal = cuspamax;
coefs = cwt(signal,scales,wname);
SCimg = wscalogram('',coefs,'scales',scales,'ydata',signal);
subplot(311)
plot(signal); ylabel('Amplitude');
subplot(312)
imagesc(1:length(signal),scales,SCimg);
axis xy;
ylabel('Scales'); xlabel('Time'); title('Wavelet Scalogram');
subplot(313)
%plot spectrogram here

Question posée :

le 29 Fév 2012

Commenté :

le 6 Août 2025

Community Treasure Hunt

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

Start Hunting!

Translated by