How to maintain NaN after calculations in tables?
5 次查看(过去 30 天)
显示 更早的评论
Sorry this is the first time I have posted a question.
I am trying to create a new column in my table using parameter like (rows = T.Age < 40). This creates a logical array of the same size as the original column, but when I create the new column and use T.new(:,:)=T.height(rows). It won't add the new column because the array is now smaller due to NaNs in my table.
How do i keep the NaN values and have it carry over and create a new column?
0 个评论
采纳的回答
Walter Roberson
2019-10-17
T.new(rows) = T.height(rows);
nanrows = isnan(T.Age);
T.new(nanrows) = nan;
更多回答(0 个)
另请参阅
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!