How to turn OFF display message of lsqr function
Mostrar comentarios más antiguos
Hello folks,
I would like to turn off the display of the result of the least square method "lsqr" matlab function, such as:
"lsqr converged at iteration 5 to a solution with relative residual 0.086."
I asked to the AI and it gives me a example code. So this could be our test bench:
% Example of using lsqr with correct parameters
A = rand(100); % Example matrix
b = rand(100,1); % Example right-hand matrix
% Set options to turn off display and specify max iterations
options = optimset('Display', 'off', 'MaxIter', 100); % Ensure MaxIter is a positive integer
% Call lsqr with options
[x, flag] = lsqr(A, b, [], options);
The problem is that the code the AI generated does not work. There is and error with the input type optims.
If you have an idea on how to make this optimisation options work or another way to turn off the display of messages from lsqr function I would be thankfull !
Best for all,
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre Sparse Matrices en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!