필터 지우기
필터 지우기

How to put NaN in certain row of particular column according to another column having NaN in some row

조회 수: 2 (최근 30일)
here in 10th column(u_py) some row is NaN , I have to put NaN in same row of 5th column (Pyrn2_Avg).
  댓글 수: 2
Ritesh
Ritesh 2023년 3월 15일
@Rik I am new in matlab, and i have used this one
data.Pyrn2_Avg(~isnan(data.Pyrn2_Avg)) = data.u_py(~isnan(data.Pyrn2_Avg));
but it replaces all value of 10th column in 5th column.
please sugest me code for this.

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

채택된 답변

VBBV
VBBV 2023년 3월 15일
data.Pyrn2_Avg(isnan(data.u_py)) = NaN; % assign NaN to this line

추가 답변 (0개)

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by