subscript for functions..?

subscript for functions..? - Messages

#1 Posted: 2/17/2011 1:05:17 PM
felted

felted

0 likes in 2 posts.

Group: User

Hello,

can you explain me the syntax for a function with subscript please.



Regards, Felted

#2 Posted: 2/17/2011 2:12:34 PM
Radovan Omorjan

Radovan Omorjan

325 likes in 2052 posts.

Group: Moderator

Hello,

I think that the definition of a function with the function arguments in the subscript of the function name is not possible. Actually, do not see the reason for that. I hope I am right.

Regards,
Radovan
When Sisyphus climbed to the top of a hill, they said: "Wrong boulder!"
#3 Posted: 2/17/2011 8:03:43 PM
Edward Ulle

Edward Ulle

20 likes in 182 posts.

Group: Moderator

For me its not even possible to have a subscripted function. When I type dot then open parenthesis the paren shifts to normal text not subscript. But be careful, if you look at the SMath file the dot is there but not visible on the screen. In otherwords if I type "f.(x)", the function name is "f.".

But if you type f.x(x)=x^2 the function name is f.x (f subscript x) and f.x(2)=4.
Ed
#4 Posted: 2/18/2011 8:44:13 AM
felted

felted

0 likes in 2 posts.

Group: User

Hm, but here http://en.smath.info/forum/default.aspx?g=posts&m=2883#post2883 smath wrote:
Quote

Subscript for variables, functions and units implemented...



Therefore I think, it sould be possible to use it.
The question ist, how?

Regards, Felted
#5 Posted: 2/18/2011 3:53:43 PM
Radovan Omorjan

Radovan Omorjan

325 likes in 2052 posts.

Group: Moderator

Hello Felted,
Wrote

Hm, but here http://en.smath.info/forum/default.aspx?g=posts&m=2883#post2883 smath wrote:

Quote

Subscript for variables, functions and units implemented...



Therefore I think, it sould be possible to use it.
The question ist, how?


I think you did not understand what Ed mentioned in its post, or we do not know what you are interested in, sorry.
On the thread you mentioned, subscripts are regarded as literal index i.e. part of the variable, function, unit name. That means that if you define a variable, function or unit you can use period in its name. After the period the folowing part of the name will be visible as subcript. When you use them you must also type the period because this is a part of their name.
Type: ABC.abc:abc
See:
[MATH=eng]ABC.abc←10[/MATH]
Type: Fun.xy(x,y):x^2[SPACE]+y^2
See:
[MATH=eng]Fun.xy(x,y)←x^2+y^2[/MATH]

It is quite different than the index of an indexed variable (vector, matrix)- here are few examples (here the integers as subscript -index represent the apropriate vector elements.)
[MATH=eng]x.abc←mat(2,6,8,3,1)[/MATH]
To see the second element in the vector you should type:
Type: x.abc[2=
See:
[MATH=eng]el(x.abc,2)=6[/MATH]
More examples:
[MATH=eng]Fun.xy(x)←mat(x,x^2,x^3,3,1)[/MATH]
[MATH=eng]el(Fun.xy(2),3)=8[/MATH]

By the way, my students often mix up those two different subscripts.

Regards,
Radovan
When Sisyphus climbed to the top of a hill, they said: "Wrong boulder!"
#6 Posted: 2/19/2011 11:57:08 AM
Edward Ulle

Edward Ulle

20 likes in 182 posts.

Group: Moderator

Typically I thing of a function as taking a value so I was curious what would happen if it took a matrix. See below.



Don't forget the xy subscript is just part of the name. Type Fun.xy. The element is accessed by the [ key. In the first case it was Fun.xy(a[2,2) and the second case Fun.xy(a)[2,2.

Have Fun.
Ed
  • New Posts New Posts
  • No New Posts No New Posts