how do i set a threshold on the values of the indices in my matrices for my entire code?

2 ビュー (過去 30 日間)
Hello,
the code i am using has many matrices. Some of these indices are very small in value. So i want to limit the value i.e. i want to add a threshold to the values of my matrix so that the absolute value is not less than 10e-10
is there a setting or function in matlab that will allow me to do this in one swoop ?
thank you

採用された回答

per isakson
per isakson 2019 年 7 月 5 日
編集済み: per isakson 2019 年 7 月 5 日
Try this
M(abs(M)<=1e-9) = 1e-9;
where M is a matrix.

その他の回答 (1 件)

Shahrazad Taher
Shahrazad Taher 2019 年 7 月 9 日
thank you for your help per isakson
i created a function that employs your approach and called it whenever i needed to clear the noise in a matrix

製品


リリース

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by