wscalogram and subplots
Mostra commenti meno recenti
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
Risposte (1)
Wayne King
il 29 Feb 2012
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 Commento
Zhao Lu
il 6 Ago 2025
very helpful !
Categorie
Scopri di più su Subplots in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!