change negative data to zero in one table in matlab
8 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Mounira
am 27 Nov. 2023
Verschoben: Dyuman Joshi
am 27 Nov. 2023
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 Kommentar
Dyuman Joshi
am 27 Nov. 2023
Verschoben: Dyuman Joshi
am 27 Nov. 2023
Find Array Elements That Meet your Condition and assign them to be 0.
Akzeptierte Antwort
chicken vector
am 27 Nov. 2023
Bearbeitet: chicken vector
am 27 Nov. 2023
% 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
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Logical finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!