필터 지우기
필터 지우기

how can i perform the calculation of the span at smoothing?

조회 수: 4 (최근 30일)
Tiago Dias
Tiago Dias 2018년 9월 27일
댓글: Tiago Dias 2019년 12월 10일
Hello,
I have some doubts on how to select the span in order to smooth all my NaN values and values.
For example, I got:
A = [5;7;9;19;NaN;NaN;NaN;NaN;5;NaN;7;NaN]
idx = [1:size(A,1)]'
B = smooth(idx,A,4,'loess')
If I use the span of 2, 3 or 4 I have the value "0" in some NaN's, if I use the span of 5, I got everything smoothed right.
I would like to know if it is possible, before doing the smooth code line, how to perform a calculation of span to ensure that the result doesn't have nan's?
Thanks for your time.
  댓글 수: 2
Al Alvino
Al Alvino 2019년 12월 10일
Hi Tiago,
Did you find a solution for your question? I have the same problem, how can i know what span value i should use in the smooth command.
Thanks
Alberto
Tiago Dias
Tiago Dias 2019년 12월 10일
I assume it is because in my index 6 the span (i think is the window he considers) i got more nans than numbers.
I would recomend to go to a moving window strategy, has matlab centers the index ( lets say index 5) and he goes 4 above and 4 below, if span is 4.
here some example

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

답변 (0개)

카테고리

Help CenterFile Exchange에서 Sources에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by