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
2012-2-29
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
类别
在 帮助中心 和 File Exchange 中查找有关 Subplots 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!