creating an empty cell in an array

8 次查看(过去 30 天)
i have an array most made up of numbers and some are NaN i would like to make the NaN cells empty because i have a plotting function that doesnt accept NaN and when i assign it to 0 it affects the resulting graph, so im not really sure of how to make it blank with no numerical value
  4 个评论
madhan ravi
madhan ravi 2019-6-21
Can’t you just ignore NaN values using isnan() ?

请先登录,再进行评论。

采纳的回答

Akshay Malav
Akshay Malav 2019-6-21
编辑:Akshay Malav 2019-6-21
Then use this code.
A = [1 NaN 2];
B = rmmissing(A) % will remove NaN from array A
The B array wil be [1 2]
  2 个评论
Ahmed Abdulla
Ahmed Abdulla 2019-6-21
the problem with this is that im plotting 2 different arrays where Nan in one array might be an actual value on the other so this will make the data miss match
Akshay Malav
Akshay Malav 2019-6-21
Then you can ignore the corresponding values in the second array .

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Line Plots 的更多信息

标签

产品


版本

R2019a

Community Treasure Hunt

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

Start Hunting!

Translated by