Table: Overwrite column value with condition
4 次查看(过去 30 天)
显示 更早的评论
I would like to overwrite all values of a specific column, but using a condition, like this:
% Dummy array values:
a = [1;2;3;4;5];
% Create a table with only 1 column 'a':
myTable = table(a);
% WRONG CODE: trying to overwrite 'a' column values
myTable = myTable(myTable.a < 3) == 0;
How could I do it?
0 个评论
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Logical 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!