Maple / Matlab symbolic operation There is a problem for a long time Is there any way to define an n-dimensional vector (or matrix) in MATLAB or maple, but n does not need to be assigned, and then symbolic operation? For example, I need to derive a function: l = 0.5 * w (T) · V · W, Where W is a variable, an n-dimensional vector, w (T) is its transpose vector; V is an n * n coefficient matrix; n > 1 is an integer In the symbolic operation of maple or MATLAB, can l be derived without n assignment? The derivation of L is very simple. It's a general formula. The problem is how to do symbolic operation on a general formula like this in the program?

Maple / Matlab symbolic operation There is a problem for a long time Is there any way to define an n-dimensional vector (or matrix) in MATLAB or maple, but n does not need to be assigned, and then symbolic operation? For example, I need to derive a function: l = 0.5 * w (T) · V · W, Where W is a variable, an n-dimensional vector, w (T) is its transpose vector; V is an n * n coefficient matrix; n > 1 is an integer In the symbolic operation of maple or MATLAB, can l be derived without n assignment? The derivation of L is very simple. It's a general formula. The problem is how to do symbolic operation on a general formula like this in the program?

Take an example
>>syms x
>> diff(sin(x^2))
ans =
2*cos(x^2)*x