Skip to main content
1-Visitor
January 20, 2020
Question

Calculating matrices with a a set of numbers in an array

  • January 20, 2020
  • 1 reply
  • 1617 views

Hello,

 

I tried to calculate a matrices with a matrix that includes a variable with a set of numbers. 

Putting an array instead of a constant number ( Vbat -->M1,1)  to the matrix the solver tells the error

"This variable is undefined". Is it possible like I tried or is there another solution to calculate the

same matrix again and again in an loop and set different given values, how to extract the results?

I found some examples but I don´t know how to transfer to my problem.

 

Thank you 

1 reply

25-Diamond I
January 20, 2020

Even for a single value of M[1,1 your solve block yield 7 equations for just 6 variables. So usually no solution can be found.

You may use the "minerr" command instead of "find" or do without a solve block and use the "lsolve" command.

Werner_E_0-1579563107600.png

If that solves your problem, you may turn the solve block or the lsolve into a function of M[1,1 and call that function vectorized to get a nested vector of solutions.

 

 

25-Diamond I
January 20, 2020

Here is what I was talking about

Werner_E_0-1579563698569.png

MC15 worksheet attached