Take a difference between the value and the lagged value dealing with NaN

조회 수: 2 (최근 30일)
alpedhuez
alpedhuez 2018년 6월 14일
답변: Sindhu Yerragunta 2018년 6월 18일
Suppose I have a table T such as
Running Dist Swimming Dist
---------------------------------------------
Jan 18 100 10
Feb 18 80 NaN
Mar 18 105 12
I want to take n-month changes of Running distance and Swimming distance. (But skips when there are NaN.)
In case of n=1, it will be
Running Dist Swimming Dist
---------------------------------------------
Feb 18 -20 NaN
Mar 18 +25 NaN
Please advise.
  댓글 수: 1
Paolo
Paolo 2018년 6월 14일
편집: Paolo 2018년 6월 14일
What's the expected output for n = 2?
What about this table
Running Dist Swimming Dist
---------------------------------------------
Jan 18 100 10
Feb 18 80 NaN
Mar 18 105 12
Apr 18 60 NaN
?

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

답변 (1개)

Sindhu Yerragunta
Sindhu Yerragunta 2018년 6월 18일
Hi Alpedhuez,
One suggestion would be cleaning your data before you calculate the difference. The following link elaborates on how to clean and standardize the missing data.
Hope this information helps.
-Sindhu

카테고리

Help CenterFile Exchange에서 Genomics and Next Generation Sequencing에 대해 자세히 알아보기

태그

제품

Community Treasure Hunt

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

Start Hunting!

Translated by