MATLAB Answers


Problem with undefined variable

Asked by Jan
on 26 Nov 2011


I'd like to construct a function Q that has a symbolic expression f(u1,u2,...,ui) as an argument.

The thing is that I don't want to declare f as being an expression of symbolic variables u1,...,ui.

I want Q to do this for me: it receives some expression with u1,...,ui (without these being defined anything) and then it declares these all as symbolic.

Is this possible?




on 26 Nov 2011

Walter Roberson
on 26 Nov 2011

Right, but the solutions referenced there all require passing the expression as a string.

1 Answer

Answer by Walter Roberson
on 26 Nov 2011
 Accepted answer

No, in order to do anything close to that, you would have to pass the expression as a string (or as a function handle, or as an inline function)


Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi test

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

MATLAB Academy

New to MATLAB?

Learn MATLAB today!