


The Symbolic work-around being to declare the variables as Symbolic Arrays to generate the individual elements of the arrays and allow for a one-to-one substitution: > w = sym('w',) While fully conforming dimensional substitutions will work just fine: > subs(f,) % All 3x3Īnd all of this derives from the Symbolic Variables themselves being treated as scalars. G = mupadmex('symobj::fullsubs',F.s,X2,Y2) New arrays must have the same dimensions or must be scalars. Even direct specification of the substitution with cell arrays throws the error: > wnum = However, when the new arrays being substituted do no match size in every dimension (as is the case here with the coefficient matrix being rectangular versus the column vector), a dimension mismatch will more than likely occur in the engine. So the expression undergoing substitution needs to play nice with element-wise application and expansion upon substitution. All constant terms in s are replaced with the constant times a vector or matrix of all 1s. If old is a scalar, and new is a vector or matrix, then subs(s,old,new) replaces all instances of old in s with new, performing all operations elementwise. The Symbolic Toolbox operates from the standpoint that Symbolic Variables are scalars and any operation or expression in which they are present uses element-wise semantics.
