On Apr 22, 7:26 am, Jason Grout <[email protected]> wrote:
> On 04/22/2010 06:02 AM, pallab wrote:
>
> > Thanks for your answer, it seems complicated :). I think it would have
> > been much easier if there is a way to specify the plot variables in
> > plots.
>
> > On Apr 22, 2:58 am, Mike Hansen<[email protected]> wrote:
> >> On Thu, Apr 22, 2010 at 2:46 AM, pallab<[email protected]> wrote:
> >>> How to specify variables in a plot. Say I want something like,
>
> >>> At=S*x
> >>> S=4
> >>> plot(At,0,2)
>
> >> Note that when you assign "S=4" it doesn't change the value of S in At.
>
> > Why not??, what is the logic behind it!!
>
> You didn't say what S was before your first line there, so for
> illustration purposes, I'll assume that you've done S=2 before.
>
> Now, when you do At=S*x, it gets the value of S and assigns At to be
> 2*x. Note that it uses the value of S immediately. So later, when you
> reassign S, it doesn't affect what you've done to At.
Sorry I did not make it clear. I just defined S as
var('S')
At=S*x
S=4
Then I guess things should be plot-able with
plot(At,(x,0,4))
> This is different than the delayed evaluation (i.e., ":=") in
> mathematica. It is more like the normal evaluation (i.e., "=") in
> mathematica. To do delayed evaluation, do something like what Mike
> suggested.
>
> Thanks,
>
> Jason
>
> --
> To post to this group, send email to [email protected]
> To unsubscribe from this group, send email to
> [email protected]
> For more options, visit this group
> athttp://groups.google.com/group/sage-support
> URL:http://www.sagemath.org
--
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org