フィルターのクリア

how to solve a system of equations?

1 回表示 (過去 30 日間)
P
P 2011 年 5 月 31 日
I have this system: J(21x21) * X(21x1)=J(21X21) * B(21x1) - F(21X1).
I have to calculate the matrix X without using the 'inv' function X=inv(A) * J * B - A, X must have this dimension(21x1) .
The matrix J,B,F are calculated.

回答 (1 件)

Matt Fig
Matt Fig 2011 年 5 月 31 日
% Choose some values:
J = rand(21);
B = rand(21,1);
F = rand(21,1);
% Calculate X based on J*X = J*B-F
X = J\(J*B-F) % Here is what you want...
% Now check:
max(abs(J*X - (J*B-F))) % This should be a small number.

カテゴリ

Help Center および File ExchangeDynamic System Models についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by