错误使用 wavelet.internal.cwt The sampling period must be specified to obtain frequencies and the 'scal' flag must be specified to obtain the scalogram. 出错 cwt (第 238 行) [varargout{1:nargout}] = wavelet.internal.cwt(x,varargin{:}); 出错 question3_cwt (第 13 行) [cwtmat, frequencies] = cwt(x, scales, 'morl');
时间: 2024-02-05 22:03:22 浏览: 983
这个错误是因为`cwt`函数需要指定采样周期和`'scal'`标志,以便计算小波变换系数的尺度和对应的频率。你可以修改代码,在调用`cwt`函数时加上这些参数,例如:
```matlab
% 连续小波变换
freqs = 1:100; % 感兴趣的频率范围
scales = fs./freqs;
[cwtmat, frequencies] = cwt(x, scales, 'morl', 'scal', 1/fs);
```
这里我们使用了`1/fs`作为采样周期,以便计算出尺度和频率。同时,我们还加上了`'scal'`标志,以便让`cwt`函数返回小波变换系数的尺度和对应的频率。
阅读全文
相关推荐







