以下是我的代码,但是图出不来,有没有大神帮忙看一看
%连续小波变换后时频图,用这个
clear,clc
close all
%%%%%% 小波变换 %%%%%%%%%%%%%%%%
fs=1024;
t=1/fs:1/fs:1;
f1=100;f2=200;f3=300;
s=cos(2*pi*f1*t.*(t>=0&t<0.3))+2*cos(2*pi*f2*t.*(t>=0.3&t<0.8))+3*sin(2*pi*f3*t.*(t>=0.8&t<=1));
%s=cos(2*pi*f1*t);
figure(1);
plot(t,s,'b')
title('原始单频信号')
temp=s+0.02*rand(size(s));%加高斯白噪声
figure(2)
plot(t,s,t,temp,'r')
%%%%%%%%%%%%%%%%%小波时频图绘制 %%%%%%%%%%%%%%%%%%%%%
wavename='cmor4-4'; %%选用带宽参数和中心频率均为4 的复morlet小波
totalscal=256; %尺度序列的长度,即scal的长度
fc=centfrq(wavename);
%%%%%%%%% 绘制时间域小波波形 %%%%%%%%%%%%%%%%%%%
cparam=2*fc*totalscal;
a=totalscal:-1:1;