Re: Very very basic question about Mathematica
- To: mathgroup at smc.vnet.net
- Subject: [mg111147] Re: Very very basic question about Mathematica
- From: Bob Hanlon <hanlonr at cox.net>
- Date: Thu, 22 Jul 2010 05:40:51 -0400 (EDT)
You are not dealing with strings. You are using symbols and expressions and none of the expressions happen to involve strings.
Manipulate is a scoping construct. Since you want s to depend on the control, bring the definition of s within the Manipulate's scope.
Manipulate[
s = x + h;
Plot[s, {x, 0, h},
PlotRange -> {{0, 1}, {0, 2}}],
{h, 0.1, 1}]
Bob Hanlon
---- Sam Takoy <sam.takoy at yahoo.com> wrote:
=============
Hi,
I find that I don't understand a very basic thing about the building
blocks of Mathematica.
When the first command is
s = x + h
I figured that (string?) "s" represents (string?) "x+h".
This theory pans out when one tries
s^2
or
D[s, x]
or
Integrate[s, {x, 0, h}]
and
s /. h -> 1
But then by doesn't this work:
Manipulate[ Plot[s, {x, 0, h}], {h, 0.1, 1}]
Many thanks in advance!