redefining variables

redefining variables - 消息

#1 已发布: 2011/7/4 22:16:53
studoc

studoc

0个赞,共17个帖子。

组: 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 已发布: 2011/7/5 01:08:08
Radovan Omorjan

Radovan Omorjan

325个赞和1个踩,共2,052个帖子。

组: 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 已发布: 2011/7/5 05:16:32
studoc

studoc

0个赞,共17个帖子。

组: 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 已发布: 2011/7/5 05:53:08
Radovan Omorjan

Radovan Omorjan

325个赞和1个踩,共2,052个帖子。

组: 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 已发布: 2011/7/9 20:45:39
studoc

studoc

0个赞,共17个帖子。

组: User

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

Stu.
#6 已发布: 2011/7/10 04:50:44
Radovan Omorjan

Radovan Omorjan

325个赞和1个踩,共2,052个帖子。

组: Moderator

You are welcome

Regards,
Radovan
When Sisyphus climbed to the top of a hill, they said: "Wrong boulder!"
  • 有新帖
  • 无新帖