1

I want to create a mathematical expression like this in MATLAB. It has a certain pattern as given below and number of terms in the expression depends on my input 'i' given input i=2, matrix T and constant 'c' then some matrix variable T_dot is given by

T_dot = T(c)-T(c-2)...
      + T(c+(8*9^0))- T(c+(8*9^0 - 2*9^1)) 

if i=3, then

T_dot = T(c)-T(c-2)...
      + T(c+(8*9^0))- T(c+(8*9^0 - 2*9^1))...
      + T(c+(8*9^0)+(8*9^1))- T(c+(((8*9^0)+(8*9^1) - 2*9^2))

if i=4, then

T_dot = T(c)-T(c-2)...
      + T(c+(8*9^0))- T(c+(8*9^0 - 2*9^1))...
      + T(c+(8*9^0)+(8*9^1))- T(c+(((8*9^0)+(8*9^1) - 2*9^2))...
      + T(c+(8*9^0)+(8*9^1)+(8*9^2))- T(c+(((8*9^0)+(8*9^1)+(8*9^2) - 2*9^3))

and so on... Clearly you can see a pattern in the above terms. Basically I have a pattern in indices of matrices, but I also want to have these expressions, because later I use T_dot as a starting point for 'for loop'. How can I create this? Should I be creating this as a string? or is there any simple way?

Thank you

0 Answers0