필터 지우기
필터 지우기

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 (최근 30일)
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

답변 (1개)

Walter Roberson
Walter Roberson 2018년 9월 27일
https://www.mathworks.com/matlabcentral/answers/420813-a-test-to-exclude-inf-and-nans-from-pinv-doesn-t-work#answer_338496

카테고리

Help CenterFile Exchange에서 Resizing and Reshaping Matrices에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by