Replace NaN with blanks
조회 수: 3 (최근 30일)
이전 댓글 표시
Hello, I have a matrix with doubles [4x1], for example,
A =
20.00
30.00
30.00
NaN
I need to remove the NaN and maintain a matrix with 4x1 size.
I tried to convert to cell and resulted, but when I use the matlab report the data output is
A { 20.00 } { 30.00 } { 30.00 } (This result is in the table in the matlab report)
and the last column is blank, which is good. So, I need one solution, or directly of the matrix I clean the NaN and maintain the 4x1 size, or change the properties output data, where the obtained results is without parentheses. Somebody help me?
댓글 수: 2
Jan
2013년 10월 14일
When you remove an element from a matrix, the matrix get smaller. There is no way to set an element of an array to an empty whatever. Only Cell arrays can contain elements of different size, but then the curly braces are obligatory. So what do you actually want to achieve? What kind of report do you want?
채택된 답변
Azzi Abdelmalek
2013년 10월 14일
편집: Azzi Abdelmalek
2013년 10월 14일
A = [20.00;30.00;30.00; NaN]
A=num2cell(A)
A(cellfun(@isnan,A))={[]}
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Logical에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

