필터 지우기
필터 지우기

Incorrect number or types of inputs or outputs for function perturb.

조회 수: 5 (최근 30일)
Kel
Kel 2024년 5월 3일
답변: Poorna 2024년 5월 16일
n = 100;
A = rand(n);
AInv = inv(A);
x = ones(n, 1);
b = A * x;
bTilde = perturb(b, 1e-10);
Incorrect number or types of inputs or outputs for function perturb.
xApp = A\b;
xTildeApp = A\bTilde;
disp('x minus xTilde')
xdiff = norm(xApp-xTildeApp)/norm(xApp);
disp('b minus bTilde')
bDiff = norm(b-bTilde)/norm(b);
disp('estimate')
normA = norm(A);
normAInv = norm(AInv);
estimate = normA*normAInv*bDiff
What's wrong with perturb function input?

답변 (1개)

Poorna
Poorna 2024년 5월 16일
Hi Kel,
How did come to know of the "perturb" function that you used? As far as I know, there is no "perturb" function to perturb a matrix. However there are "perturb" functions within different toolboxes that accepts different kinds of inputs. Two of them are listed below:
For your use case, you could manually create a perturbation matrix and add it to the input to create a perturbed matrix.
Hope this Helps!

카테고리

Help CenterFile Exchange에서 ASK에 대해 자세히 알아보기

제품


릴리스

R2024a

Community Treasure Hunt

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

Start Hunting!

Translated by