MATLAB Answers

0

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

Asked by Shahrazad Taher on 5 Jul 2019
Latest activity Answered by Shahrazad Taher on 9 Jul 2019
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

  0 Comments

Sign in to comment.

2 Answers

Answer by per isakson
on 5 Jul 2019
Edited by per isakson
on 5 Jul 2019
 Accepted Answer

Try this
M(abs(M)<=1e-9) = 1e-9;
where M is a matrix.

  0 Comments

Sign in to comment.


Answer by Shahrazad Taher on 9 Jul 2019

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

  0 Comments

Sign in to comment.



Translated by