Usage of the commande nnls(A,b,tol) in MATLAB new versions

조회 수: 2 (최근 30일)
Poulmdé
Poulmdé 2024년 6월 10일
댓글: Poulmdé 2024년 6월 13일
Hello,
I want to solve the following non negative least squares problem : nnls(A,b,tol). Given a matrix A, a vector b and a tolerance tol, I want to fin x such ||A*x-b||^2 < tol* ||b||^2 with x>=0
Does someone have any idea how to do it in matlab ?
Regards !

답변 (1개)

Animesh
Animesh 2024년 6월 10일
In MATLAB, you can solve a non-negative least squares (NNLS) problem using the 'lsqnonneg' function.
To read more about it, please refer to the following link - https://www.mathworks.com/help/matlab/ref/lsqnonneg.html
  댓글 수: 2
Poulmdé
Poulmdé 2024년 6월 10일
Thank you for your answer @Animesh
But I don't know how to use this 'lsqnonneg' with a tolerance imposed. Actually, I am not looking for the solution that minimizes the residual norm but the first one such that the residual fullfils the tolerance.
Thanks !
Poulmdé
Poulmdé 2024년 6월 13일
@Animesh, problem has been solved. Thank you for your help.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Linear Least Squares에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by