Is there any way to multiply strings like they're variables?

39 views (last 30 days)
Hi all, So Im trying to write some code that will allow me to find a state space. In order to do this, I need to multiply some matrices. However, some of the matrices are filled with transformers-which im currently representing as -and would be helpful to represent as- strings. (I could define the values of these transformers, but I really want to "see" the final multiplied transformer combinations, not the numerical values of there products). The problem is, whenever I try to define matrices with stings in them, matlab doesn't preserve the columns, I just get matrices with rows of all the strings multiplied together. Is there a way to multiply strings like variables?
Ive attached the code of my incorrect attempt below.
I=[1 0; 0 1;]
E=['-T15_11' '-T15_12' '-T15_13' '-T15_14'; '-T16_11' '-T16_12' '-T16_13' 'T16_14';]
F=[['((I1/I17)*T11_15)', '((I1/I18)*T11_16)'], ['((I2/I17)*T12_15)', '((I2/I18)*T12_16)'], ['((I3/I17)*T13_15)', '((I3/I18)*T13_16)'], ['((I4/I17)*T14_15)', '((I4/I18)*T14_16)']]
A=[[0, 0], [0, 0]];
B=[[0, 0, 'T15_12', 'T15_14'], [0, 0, 'T16_12', 'T16_14']];
ABcoef=(I-(E*F));
Anew=inv(ABcoef)*A
Bnew=inv(ABcoef)*B
Thanks.

Answers (1)

Azzi Abdelmalek
Azzi Abdelmalek on 7 Jan 2016

Community Treasure Hunt

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

Start Hunting!