Azzera filtri
Azzera filtri

Hello, please help me solve this problem in converting cwt.

2 visualizzazioni (ultimi 30 giorni)
clc
clear
close all
%%
Fs = 1e3;
t = 0:1/Fs:2;
x = cos(2*pi*32*t).*(t>=0.1 & t<0.3) + exp(-t.^4).*sin(2*pi*64*t).*(t>=0.7 & t<1)+4*exp(-t).*sin(2*pi*20*t).*(t>=0.9);
plot(t,x,'color',[0 0 0])
xlabel('Time(s)')
ylabel('Function value')
fig = gcf;
set(0,'DefaultFigureWindowStyle','normal')
set(fig,'Position', [500 300 600 300]);
box on
ax = gca;
ax.LineWidth = 2;
ax.FontSize = 10;
ax.FontAngle = 'normal';
ax.FontWeight = 'Bold';
figure
cwt(x,Fs)
fig = gcf;
set(0,'DefaultFigureWindowStyle','normal')
set(fig,'Position', [500 300 600 300]);
box on
ax = gca;
ax.LineWidth = 2;
ax.FontSize = 10;
ax.FontAngle = 'normal';
ax.FontWeight = 'Bold';
%%
figure ;
wgnNoise = .4*randn(size(t));
x1 = x + wgnNoise;
plot(t,x1,'color',[0 0 0])
xlabel('Time(s)')
ylabel('Function value')
fig = gcf;
set(0,'DefaultFigureWindowStyle','normal')
set(fig,'Position', [500 300 600 300]);
box on
ax = gca;
ax.LineWidth = 2;
ax.FontSize = 10;
ax.FontAngle = 'normal';
ax.FontWeight = 'Bold';
figure
cwt(x1,Fs)
fig = gcf;
set(0,'DefaultFigureWindowStyle','normal')
set(fig,'Position', [500 300 600 300]);
box on
ax = gca;
ax.LineWidth = 2;
ax.FontSize = 10;
ax.FontAngle = 'normal';
ax.FontWeight = 'Bold';
When executing the program I get the following error message:
Warning: Struct field assignment overwrites a value with class "double". See MATLAB R14SP2
Release Notes, Assigning Nonstructure Variables As Structures Displays Warning, for details.
> In mmm2 at 16
Error using cwt (line 145)
Not enough input arguments.
Error in mmm2 (line 21)
cwt(x,Fs)
  1 Commento
DGM
DGM il 2 Nov 2021
I don't have WT, but this seems to run fine in-browser.
Fs = 1e3;
t = 0:1/Fs:2;
x = cos(2*pi*32*t).*(t>=0.1 & t<0.3) + exp(-t.^4).*sin(2*pi*64*t).*(t>=0.7 & t<1)+4*exp(-t).*sin(2*pi*20*t).*(t>=0.9);
% ...
cwt(x,Fs)
I see there is more than one version of cwt(), as it's changed across versions.
If you're stuck with the older version, I'm guessing you'll have to figure out if you can use it for your purposes. The syntax and output differ, and the documentation is a bit sparse.

Accedi per commentare.

Risposte (0)

Categorie

Scopri di più su Colormaps in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by