linear equation with summation

2 ビュー (過去 30 日間)
Ben Andersson
Ben Andersson 2020 年 7 月 6 日
コメント済み: Ben Andersson 2020 年 7 月 6 日
The equation is given as . D and A are given through matrices. I need to calculate q.
I use operator / to solve linear equation, so that q=A/D. The question is, how to account for summation in this case? q=0,before cycle and then q=q+q;?
  2 件のコメント
madhan ravi
madhan ravi 2020 年 7 月 6 日
Paste what you have tried so far?
Ben Andersson
Ben Andersson 2020 年 7 月 6 日
n=10;
a=0.1:0.1:1;
A=[a;a;a;a;a;a;a;a;a;a;];
d=0.5:0.5:5;
D=[d;d;d;d;d;d;d;d;d;d;];
q=zeros(n,n);
for m=1:n
for t=1:n
for j=1:n
q(m,j)=A(m,t)/D(j,t);
q(m,j)=q(m,j)+q(m,j);
end
end
end

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

採用された回答

Matt J
Matt J 2020 年 7 月 6 日
編集済み: Matt J 2020 年 7 月 6 日
q=A/D should already account for the summation. Your equation can be written just by replacing the summation with simple matrix multiplication. In this form, the equation is just q*D=A and you have rightly used q=A/D to solve it.
  1 件のコメント
Ben Andersson
Ben Andersson 2020 年 7 月 6 日
thanks!

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeCalculus についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by