The Math Forum

Search All of the Math Forum:

Views expressed in these public forums are not endorsed by NCTM or The Math Forum.

Math Forum » Discussions » Software » comp.soft-sys.matlab

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

Topic: Evaluating symbolic functions at specific values of the symbols
Replies: 4   Last Post: Mar 10, 2013 1:03 AM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]

Posts: 2
Registered: 2/22/12
Evaluating symbolic functions at specific values of the symbols
Posted: Feb 22, 2012 7:09 PM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

I am trying to evaluate a symbolically integrated or differentiated function at a specific value of x or t.

For instance, if I start with the code:

% That tells the program to treat x and t as symbols so that I can do symbolic differentiation.

u = sin(t*x)
% u is my function of interest

%This differentiates sin(t*x) with respect to x, giving me t*cos(t*x), as hoped.

But now, I would like to evaluate w at some value, for instance t = 2 and x = 3, so that I could put:
neww = "evaluate" w @ t=2 and x=3

Which would hopefully yield 1.923 as the value for w at this point "2*cos(2*3)" .

I have been trying to make function handles for w, using t and x as inputs, but I apparently need the symbols for x and t to use the differentiation command, so it isn't working. I have been looking at assignin, evalin, clearvars, vpa, and pretty much anything I could think of, but I haven't figured out a way to do it. Any ideas? Help is greatly appreciated.

Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© The Math Forum at NCTM 1994-2018. All Rights Reserved.