필터 지우기
필터 지우기

How to create dummy variable?

조회 수: 2 (최근 30일)
Maty
Maty 2013년 7월 17일
Hi all, I have a data matrix of dimension 100x5(time series) I have an outlier for the 75th value of the 4th column so I decide to construct a dummy variable for this outlier.
How can I do this?
Thanks in advance for your consideration and any help
  댓글 수: 1
Muthu Annamalai
Muthu Annamalai 2013년 7월 17일
Your question is not clear enough.
Do you want to find NaN values from your data? isnan maybe something you are interested in, to help pick NaN from data.
What is a 'dummy variable' ? Do you want to replace,
A(75,4) = 0 ; %eliminate the outlier ?

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

채택된 답변

Iain
Iain 2013년 7월 17일
Use the mean of the two "surrounding" points
A(75,4) = A(74,4) + A(76,4);
Fit a curve to the known points, and then evaluate it at that point: (or interpolate...)
p = polyfit(times([1:74 76:end]),A([1:74 76:end],4),4); A(75,4) = polyval(p,times(75)); & That uses a 4th order polynomial

추가 답변 (0개)

카테고리

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

태그

Community Treasure Hunt

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

Start Hunting!

Translated by