[A,b] = equationsT​oMatrix(eq​ns,vars), large amount of vars

1 回表示 (過去 30 日間)
Jeffrey
Jeffrey 2014 年 9 月 1 日
コメント済み: Star Strider 2014 年 9 月 1 日
I want to use the function
[A,b] = equationsToMatrix(eqns,vars)
Where vars is [A1, A2, A3, A4, ... An], is there a way to do this automatically without typing out every variable up to An?

採用された回答

Star Strider
Star Strider 2014 年 9 月 1 日
I would make ‘A’ a vector (or matrix). Then:
A = [A1 A2 ... An];
You can pass it simply as ‘A’. You can recover its elements as necessary as A(1)...A(n) The exact assignments vary if ‘A’ is a matrix instead of a vector.
I can’t be more specific than that with what you have presented in your Question.
  4 件のコメント
Jeffrey
Jeffrey 2014 年 9 月 1 日
That worked really well. Thanks!
Star Strider
Star Strider 2014 年 9 月 1 日
My pleasure!

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeCharacters and Strings についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by