-1

I have a syms Array in MatLab:

syms A11 A12 A13 A21 A22 A23 A31 A32 A33 a b c x y z

A=[A11 A12 A13;A21 A22 A23;A31 A32 A33]

.

How do I replace a symbolic variable A11 with an equation:

A11=a*x+b*y+c*z

1 Answers1

2

Try

A = sym('[A11 A12 A13;A21 A22 A23;A31 A32 A33]');

A = subs(A,'A11','a*x+b*y+c*z');

or

A = subs(A,{'A11','A12'},{'a*x+b*y+c*z','100'});
John Alexiou
  • 28,472
  • 11
  • 77
  • 133
  • ??? Subscript indices must either be real positive integers or logicals. Error in ==> EigenValuesVectors4x4ToTensorFactor at 10 f=sym(zeros(4,4,4)) – artis_meditari Jun 29 '13 at 00:31
  • Better yet, create the `A` matrix this way: `A = sym('A%d%d',[3 3]);`. – horchler Jun 29 '13 at 17:10
  • 1
    @artis_meditari: there is no `f` in the code you posted above or the answer code, the error is from somewhere else. By the way did [this answer](http://stackoverflow.com/a/17369389/1698972) answered your question yesterday? – p8me Jun 29 '13 at 17:23