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?

采纳的回答

Walter Roberson
Walter Roberson 2019-10-17
T.new(rows) = T.height(rows);
nanrows = isnan(T.Age);
T.new(nanrows) = nan;

更多回答(0 个)

类别

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

标签

产品

Community Treasure Hunt

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

Start Hunting!

Translated by