finding NON in matrix

Hi all In the matrix A which is 1*N matrix, I want to recognize if there is any element equal to NON in it,I replace it by zero.How can I do that?

댓글 수: 2

Sean de Wolski
Sean de Wolski 2011년 5월 24일
Do you mean NaN?
rahman
rahman 2011년 5월 24일
Oops!!
that a really big mistake!
yes, NON means NaN ;)

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

 채택된 답변

Laura Proctor
Laura Proctor 2011년 5월 24일

0 개 추천

I'm going to assume that you mean NaN. You can use the ISNAN function to find and replace the NaNs in your code. Here's an example:
A = randn(1,100);
A([2,10,23,47,88]) = NaN;
A(isnan(A)) = 0;

추가 답변 (1개)

Sean de Wolski
Sean de Wolski 2011년 5월 24일

0 개 추천

A(isnan(A)) = 0;

카테고리

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

질문:

2011년 5월 24일

Community Treasure Hunt

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

Start Hunting!

Translated by