フィルターのクリア

Replace NaN with blanks

1 回表示 (過去 30 日間)
Paulo Oliveira
Paulo Oliveira 2013 年 10 月 14 日
コメント済み: Paulo Oliveira 2013 年 10 月 14 日
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
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?
Paulo Oliveira
Paulo Oliveira 2013 年 10 月 14 日
Thank you for your answer So, I need search other way.
Let see example 1 and example 2,
example1
example2
This image show a line of my report. Do you know work with matlab report explorer? As I do not see a solution, If you know, do you explain me how to insert code in report explorer? In that case, I insert a code with a condition if for each table row.
Do you understand me?

サインインしてコメントする。

採用された回答

Azzi Abdelmalek
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))={[]}
  1 件のコメント
Paulo Oliveira
Paulo Oliveira 2013 年 10 月 14 日
Thank you for your answer. However, when I use that code, in the report appears the symbols {} and I need to remove them, both for numeric data or in NaN. There is a way to remove that symbols?

サインインしてコメントする。

その他の回答 (0 件)

Community Treasure Hunt

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

Start Hunting!

Translated by