Add NaN in the first row of a table
5 次查看(过去 30 天)
显示 更早的评论
I have a table (size 449801x1). I want to add NaN in the first row of the table. How do I do this?
0 个评论
回答(1 个)
Aquatris
2024-9-19
Assuming all your entries are numeric, since you want to assign NaN, here is one way;
% create dummy table
Age = [38;43;38;40;49];
Height = [71;69;64;67;64];
Weight = [176;163;131;133;119];
T = table(Age,Height,Weight);
T
% assign NaN to 1st row
T(1,:) = array2table(NaN(size(T(1,:))));
T
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 NaNs 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!