Automatically create matrix based on sum of rows and variable in Mathcad
Hello everyone,
I am trying to automatize a calculation process in Mathcad, but I am having some difficulties doing it.
Lets say I have a matrix with “n x m” number of rows and columns.
In this example we can have the following matrix (5 x 6 – but it can be different, ex: 10 x 15, 9 x 10 etc...):

Note that Ni is each row of the matrix.
There is a variable “var” that can be equal to 1, 2, 3 or 4.
And finally we have vector “V” (that has always 1 single column, but number of rows depends on the variable “var” however this vector is an input, the values below are just an example):

I want to obtain the following matrix “M” depending on the variable “var”:
- If var = 1 (“V” vector will have just 1 row – F1 = 10)

- If var = 2 (“V” vector will have 2 rows – F1 = 10 / F2 = 1)

- If var = 3 (“V” vector will have 3 rows – F1 = 10 / F2 = 1 / F3 = 4)

- Finally if var = 4 (“V” vector will have 4 rows – F1 = 10 / F2 = 1 / F3= 4 / F = 7)

Any suggestions?
Thank you so much for your help,
Miguel
