my program throws multiple exceptions but I want to code it like that when it receives first exception should not move furthur and quit by returning a value
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
input to svd is
Inf NaN NaN
NaN NaN NaN
NaN NaN NaN
Error using svd
Input to SVD must not contain NaN or Inf.
CODE IS:::
s = svd(A);
if any(s == 0) % Handle singular matrix
c = Inf(class(A));
else
c = max(s)./min(s);
if isempty(c)
c = zeros(class(A));
end
end
0 comentarios
Respuestas (1)
Walter Roberson
el 27 de Sept. de 2018
https://www.mathworks.com/matlabcentral/answers/420813-a-test-to-exclude-inf-and-nans-from-pinv-doesn-t-work#answer_338496
0 comentarios
Ver también
Categorías
Más información sobre Resizing and Reshaping Matrices en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!