MATLAB Answers

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

  댓글 수: 0

로그인 to comment.

채택된 답변

per isakson
per isakson 5 Jul 2019
per isakson 님이 편집함. 5 Jul 2019
Try this
M(abs(M)<=1e-9) = 1e-9;
where M is a matrix.

  댓글 수: 0

로그인 to comment.

More Answers (1)

Shahrazad Taher
Shahrazad Taher 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

로그인 to comment.

이 질문에 답변하려면 로그인을(를) 수행하십시오.


Translated by