Error When Using fillmissing Function on Table
显示 更早的评论
I have a table and I am trying to replace all the NaN values with 0. Based on the documentation for 'fillmissing' this should be straightforward but when I execute the commands:
d = [NaT; NaT; NaT; NaT; NaT];
x = [2; 4; 3; NaN; NaN];
t = table(d,x)
fillmissing(t,'constant',0)
It produces the following error:
Error using fillmissing/checkArrayType (line 517)
Invalid fill constant type.
Error in fillmissing/fillTableVar (line 155)
[intConstVj,extMethodVj] = checkArrayType(Avj,intMethod,intConstVj,extMethodVj,x,true);
Error in fillmissing/fillTable (line 133)
B.(vj) = fillTableVar(indVj,A.(vj),intMethod,intConst,extMethod,x,useJthFillConstant,useJthExtrapConstant);
Error in fillmissing (line 116)
B = fillTable(A,intM,intC,extM,x,dataVars);
Why do I get this error and how can I prevent this?
采纳的回答
更多回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Tables 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!