evalAt() does not work any way I use it
1 view (last 30 days)
Show older comments
When I try using evalAt() function I always get an error. I have tried using it in many different ways.
Example 1:
y=x^2;
evalAt(y, x=3)
Error: File: plot_test.m Line: 2 Column: 12
The expression to the left of the equals sign is not a valid target for an assignment.
I also tried to use subs() and still get error.
I also tried reinstalling MATLAB and did not work.
I will really appretiate any help, Thanks
3 Comments
Walter Roberson
on 19 Oct 2012
Yes, but the ability to use "=" in a symbolic expression (as opposed to assignment) is new in R2012a.
subs(y, x, 3)
not
subs(y, x=3)
Accepted Answer
Star Strider
on 19 Oct 2012
Edited: Star Strider
on 19 Oct 2012
Starting with 2012a, you can Create Symbolic Functions. This is probably the easiest way to do what you want:
syms x y
y(x) = x^2
z = y(3)
giving this result:
y(x) =
x^2
z =
9
0 Comments
More Answers (3)
Matt Fig
on 19 Oct 2012
Edited: Matt Fig
on 19 Oct 2012
What do you see when you type these? Do you see the help, or do you see function not found?
help evalAt
help subs
If you see 'function not found', then you don't have the symbolic toolbox installed, or you don't have a license checked out.
0 Comments
Sachin Ganjare
on 19 Oct 2012
Edited: Sachin Ganjare
on 19 Oct 2012
Most probably you do not have 'Symbolic Math Toolbox' installed on your system. Check using 'ver' command.
0 Comments
See Also
Categories
Find more on Thermodynamics & Statistical Physics in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!