필터 지우기
필터 지우기

Smoothing the data for different windowsizes (for loop)

조회 수: 1 (최근 30일)
Pree
Pree 2015년 8월 25일
댓글: Pree 2015년 8월 25일
I have a for loop for different windowsize to smooth the data.
My m file first reads the xlsx file that I want to smooth. Then I have the windowsize for loop which looks like this:
for windowsize=[1,5:5:180]
...
%%%here there are various calculations that I want to do for each windowsize
...
%%%right at the bottom of the mfile there is end for the windowsize loop.
end
I get different results when I just use a particular windowsize (eg for windowsize=100) than when I use the for loop for lots of windowsize (eg for windowsize=[1,5:5:180])
It differs hugely when the windowsize is large.
Is it because I am smoothing the data that I have already smoothed with the previous windowsize?
But within the windowsize for loop, I have added a line which has the raw data so after it is done with the first windowsize, it should return back to the raw data and smooth it with the next windowsize.
I don't know what else would affect the results.
  댓글 수: 2
Walter Roberson
Walter Roberson 2015년 8월 25일
We are going to need your code. If it is large then use the paperclip to attach it.
Pree
Pree 2015년 8월 25일
here is the file

댓글을 달려면 로그인하십시오.

채택된 답변

Walter Roberson
Walter Roberson 2015년 8월 25일
I suggest you move the body of the loop into a new routine and pass appropriate values to it, and return the necessary values. That way you know that any variables that are local to the new function are going to be reset each time the function is called.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Creating and Concatenating Matrices에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by