フィルターのクリア

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 Center および File ExchangeCreating and Concatenating Matrices についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by