Hello,
here is the data.
a = [-2 -1 2 3]
b = [1 2 3 4]
c=a.*b
c = [-2 -2 6 12]
right?
but I want to make the NaN value to the negative c data..
in this case, c = [NaN NaN 6 12]
How to do that?
values of b can vary depending on my initial condition, so I need the code which change to NaN automatically.

 채택된 답변

madhan ravi
madhan ravi 2020년 6월 11일

0 개 추천

c(c<0) = NaN

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Logical에 대해 자세히 알아보기

제품

태그

질문:

2020년 6월 11일

댓글:

2020년 6월 12일

Community Treasure Hunt

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

Start Hunting!

Translated by