Solving linear equations simultaneoulsy.

3 ビュー (過去 30 日間)
Giuseppe
Giuseppe 2014 年 3 月 26 日
コメント済み: Matt J 2014 年 3 月 26 日
I have a vector of m and a vector of c values for a set of linear expressions. I have a value for m and c for a single expression. What I want to do is solve the linear equation for all the m and c values. How would I simultaneously solve this expression with every one in the two corresponding vectors.
i.e.
y=2x +5
m=[3 4 5]
c=[2 3 6]
y=2x+5 with y=3x +2
y=2x+5 with y=4x+3
y=2x+5 with y=5x+6

採用された回答

Matt J
Matt J 2014 年 3 月 26 日
編集済み: Matt J 2014 年 3 月 26 日
x=(5-c)./(m-2);
y=2*x+5;
  4 件のコメント
Giuseppe
Giuseppe 2014 年 3 月 26 日
I have a vector with different values for y=2x+5
Matt J
Matt J 2014 年 3 月 26 日
for i=1:length(gra)
x{i} = (gra(i)- c)./ (m-yint(i));
y{i} = m.*x{i}+c;
end

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeOperating on Diagonal Matrices についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by