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

1 Ansicht (letzte 30 Tage)
Jeffrey
Jeffrey am 1 Sep. 2014
Kommentiert: Star Strider am 1 Sep. 2014
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?

Akzeptierte Antwort

Star Strider
Star Strider am 1 Sep. 2014
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 Kommentare
Jeffrey
Jeffrey am 1 Sep. 2014
That worked really well. Thanks!

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Characters and Strings finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by