F=Kff*uf - Matrix operation

4 ビュー (過去 30 日間)
BioZ
BioZ 2021 年 5 月 11 日
コメント済み: Rik 2021 年 5 月 11 日
Greetings everyone, I am trying to do some simple matrix operation in Matlab.
I have equation: Ff=Kff*Uf where Ff is 3x1 matrix, Kff is 3x3 matrix and Uf is 3x1 matrix. As in the following picture.
How can I solve this to find U1,U2,U3 in matlab?
When I attempt solving this with matlab I get number of errors such as: (Error using / ).
Any help would be much appreciated. Thank you.
clc
clear
F = [383.02;
321.39;
0;];
Kff = [634.8 -191.2 -353.6;
-191.2 447.3 353.6;
-353.6 353.6 683;];
%%Uf = F./Kff

採用された回答

Rik
Rik 2021 年 5 月 11 日
You were almost there:
F = [383.02;
321.39;
0;];
Kff = [634.8 -191.2 -353.6;
-191.2 447.3 353.6;
-353.6 353.6 683;];
Uf=Kff\F
Uf = 3×1
0.8703 1.2431 -0.1930
fprintf('%.5f\n',F-Kff*Uf)%check if they are indeed equal (within a rouding error)
0.00000 0.00000 -0.00000

その他の回答 (1 件)

EmirBeg
EmirBeg 2021 年 5 月 11 日
Maybe like this?
F = [383.02;
321.39;
0;];
Kff = 10^2* [634.8 -191.2 -353.6;
-191.2 447.3 353.6;
-353.6 353.6 683];
Uf = F'/Kff; % You used a dot but u need to use ' to transpose
  1 件のコメント
Rik
Rik 2021 年 5 月 11 日
Almost. You would have to transpose the result again to make sure Uf is a column vector.
F = [383.02;321.39;0];
Kff = 10^2* [634.8 -191.2 -353.6;-191.2 447.3 353.6;-353.6 353.6 683];
Uf = (F.'/Kff).'
Uf = 3×1
0.0087 0.0124 -0.0019
fprintf('%.5f\n',F-Kff*Uf)%check if they are indeed equal (within a rouding error)
0.00000 -0.00000 0.00000

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeLoops and Conditional Statements についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by