change negative data to zero in one table in matlab
9 次查看(过去 30 天)
显示 更早的评论
Hello,
so i have table with negative values and also with some values above zero but very small, for example: 0.00001 and i want these values to be zero in the table,
can i make some kind of a code or what?
thanks in advance
1 个评论
Dyuman Joshi
2023-11-27
移动:Dyuman Joshi
2023-11-27
Find Array Elements That Meet your Condition and assign them to be 0.
采纳的回答
chicken vector
2023-11-27
编辑:chicken vector
2023-11-27
% Create fictitious set of data:
tableData = rand(1e1) - .5
% Define tolerance under which data is set to zero:
tol = 1e-2;
% Udpate table:
tableData(tableData<=tol) = 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!