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

回答 (1 件)

Wayne King
Wayne King 2012 年 2 月 29 日

2 投票

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

1 件のコメント

Zhao Lu
Zhao Lu 2025 年 8 月 6 日
very helpful !

サインインしてコメントする。

質問済み:

2012 年 2 月 29 日

コメント済み:

2025 年 8 月 6 日

Community Treasure Hunt

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

Start Hunting!

Translated by