redefining variables

redefining variables - Messages

#1 Posted: 7/4/2011 10:16:53 PM
studoc

studoc

0 likes in 17 posts.

Group: User



This is what I would like to do, but when I follow this procedure, when typing the variable again I am prompted with the already stored result...

How can I fix this...?

cheers,

Stu.
#2 Posted: 7/5/2011 1:08:08 AM
Radovan Omorjan

Radovan Omorjan

325 likes in 2052 posts.

Group: Moderator

Sorry Stu,

I do not understand your question. Could you be more specific please.

Regards,
Radovan

When Sisyphus climbed to the top of a hill, they said: "Wrong boulder!"
#3 Posted: 7/5/2011 5:16:32 AM
studoc

studoc

0 likes in 17 posts.

Group: User

Sure, thanks Radovan,

what I want to do is input changing values to a variable used in an equation I have defined in one of my calc sheets. Actually, the way I use this program, I would often do this...

I have written an equation, then defined the variables, subsequently, in order to arrive at an acceptable solution to the equation, I will need to change the value of one of the variables.

The above example suggested to me that as long as you write the equation first and then define the variables you could subsequently change a variable and therefore get amended results for the equation.

When I did this in my sheet, retyping "a=", the program immediately jammed in the already defined value of "a", so I don't get to amend the variable and therefore amend the result to the equation....

Stu.
#4 Posted: 7/5/2011 5:53:08 AM
Radovan Omorjan

Radovan Omorjan

325 likes in 2052 posts.

Group: Moderator

Hell Stu,
Wrote


When I did this in my sheet, retyping "a=", the program immediately jammed in the already defined value of "a", so I don't get to amend the variable and therefore amend the result to the equation....


I hope I understood your problem.

There is the difference between "definition - operator := " and "numerical evaluation - operator =".
When yuo type "A=" you will see (in the case A was not already defined above or to the left):
[MATH=eng]A←#[/MATH]
SMath will ask you to "define" the variable named A because it was not previously defined. Now, when you define the variable:
[MATH=ang]A←10.5[/MATH]
And type "A=" afterwards you will have "numerical evaluation" and get the value of variable A:
[MATH=eng]A=10.5[/MATH]
If you want to redefine A, you must type "A:" (not "A=" ) and to get again
[MATH=eng]A←#[/MATH]
in order to redefine the value of A

I think that your problem was in using "=" operator instead of ":=" for redefining variables

An example:

Type
f(x)=x+a
SMath
[MATH=eng]f(x)←x+a[/MATH]
ATTENTION: you typed "=" but on the screen you will see ":=" because f(x) was not already defined
Type
a=5 or a:5
SMath
[MATH=eng]a←5[/MATH]
Type
f(1)=
SMath
[MATH=eng]f(1)=6[/MATH]
Now, if you want to change a - you MUST
Type
a:11
Smath
[MATH=eng]a←11[/MATH]
Type
f(1)=
SMath
[MATH=eng]f(1)=12[/MATH]

Regards,
Radovan
When Sisyphus climbed to the top of a hill, they said: "Wrong boulder!"
#5 Posted: 7/9/2011 8:45:39 PM
studoc

studoc

0 likes in 17 posts.

Group: User

Sorry, don't think I replied to you... this is exactly what I was looking for, thanks Radovan...!

Stu.
#6 Posted: 7/10/2011 4:50:44 AM
Radovan Omorjan

Radovan Omorjan

325 likes in 2052 posts.

Group: Moderator

You are welcome

Regards,
Radovan
When Sisyphus climbed to the top of a hill, they said: "Wrong boulder!"
  • New Posts New Posts
  • No New Posts No New Posts