Error when using sgolayfilt

13 views (last 30 days)
Anna Arnesson
Anna Arnesson on 26 Feb 2021
Commented: Mathieu NOE on 26 Feb 2021
Hello, I want to use sgoalyfilt(x,order,framelen) but gets the error "Input arguments must be 'double'" and I cant´t understand why it dosn't work?
I use it like this:
order=4;
framelen=556497; % dosen't matter if I use 51 or 5 either, it gives the same error
P1_filt = sgolayfilt(P1,order,framelen) % where P1 is my measures values in a vector 1112992X1
Grateful for some help!

Accepted Answer

Mathieu NOE
Mathieu NOE on 26 Feb 2021
hello Anna
are you sure P1 is type double ?
the code works on my side with dummy rand input
P1 = randn(1112992,1);
order=4;
framelen=5111;
P1_filt = sgolayfilt(P1,order,framelen); % where P1 is my measures values in a vector 1112992X1
  4 Comments
Anna Arnesson
Anna Arnesson on 26 Feb 2021
oh, miss that point! Now I used double(P1) and it works. Tanks for the help!
Mathieu NOE
Mathieu NOE on 26 Feb 2021
you're welcome !

Sign in to comment.

More Answers (0)

Categories

Find more on Get Started with Signal Processing Toolbox in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!