moving averag : Out of memory. The likely cause is an infinite recursion within the program.
Show older comments
Hello
In the use of the MovavgFilt.m code. that from the link:
https://www.mathworks.com/matlabcentral/fileexchange/35925-moving-average-filter
It has been achieved with an error:
Out of memory. The likely cause is an infinite recursion within the program.
Error in movavgFilt (line 16)
Out = movavgFilt (In, Len, Param);
Please guide
Also, I did not enter my data because I encountered an error with the data that was written in the code itself
3 Comments
"In the use of the MovavgFilt.m code. that from the link..."
...which you modified by uncommenting the example within the function help, including one line which calls the function itself.
You could copy that help example to another file, but it will not work like you tried by simply uncommenting it.
Why not just call the function, like it was designed for?
Rahim Nami
on 26 Sep 2022
Stephen23
on 26 Sep 2022
"I use the function without the default example and with my own data, I get the following error: Error using horzcat Dimensions of arrays being concatenated are not consistent."
The function assumes (but does not check) that the first input is a row vector. Nor does it document this requirement.
A better-written function would either check this or allow a vector of any orientation.
Answers (1)
David Hill
on 26 Sep 2022
m=readmatrix('TX.txt');
x=movavgFilt(m(:,2)',5,'Center');%data needs to be row vector
1 Comment
Rahim Nami
on 1 Oct 2022
Categories
Find more on Whos in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!