>> clear x >> exp(-x)+sin(x)
??? Undefined function or variable 'x'.The `value' given to a variable does not need to be a numerical value. For example, the `value' of a variable could also be a `string'. This is an expression between quotes ('). In fact, we have already been using this with
fminbnd. Consider the result of
>> f='exp(-x)+sin(x)' f = exp(-x)+sin(x) >> ezplot(f,[0 2*pi])The variable
Zero found in the interval: [3, 4].
These commands do not give an error message, because of the fact that by specifying the search interval we have temporarily given
>> x = sym('x')
>> syms x
which gives the same result.
You can give a symbolic value to more than one variable at the same time in the following way:
syms x y z
You can now manipulate with these variables to your heart's desire.
>> v = x^3 + y^2 + 1
>> w = sin(z)