フィルターのクリア

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

2 ビュー (過去 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 Center および File ExchangeLogical についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by