Rank: Newbie
Groups: Registered
Joined: 17/02/2011(UTC) Posts: 2
|
Hello, can you explain me the syntax for a function with subscript please. Regards, Felted
|
|
|
|
Rank: Administration Groups: Registered, Advanced Member Joined: 23/06/2009(UTC) Posts: 1,740 Was thanked: 318 time(s) in 268 post(s)
|
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!" |
|
|
|
Rank: Advanced Member Groups: Registered
Joined: 04/07/2010(UTC) Posts: 178 Was thanked: 19 time(s) in 13 post(s)
|
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. Edited by user 18 February 2011 02:08:00(UTC)
| Reason: Not specified |
Ed |
|
|
|
Rank: Newbie
Groups: Registered
Joined: 17/02/2011(UTC) Posts: 2
|
|
|
|
|
Rank: Administration Groups: Registered, Advanced Member Joined: 23/06/2009(UTC) Posts: 1,740 Was thanked: 318 time(s) in 268 post(s)
|
Hello Felted, 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: ABC.abc←10Type: Fun.xy(x,y):x^2[SPACE]+y^2 See: Fun.xy(x,y)←x^2+y^2It 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.) x.abc←mat(2,6,8,3,1)To see the second element in the vector you should type: Type: x.abc[2= See: el(x.abc,2)=6More examples: Fun.xy(x)←mat(x,x^2,x^3,3,1)el(Fun.xy(2),3)=8By 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!" |
|
|
|
Rank: Advanced Member Groups: Registered
Joined: 04/07/2010(UTC) Posts: 178 Was thanked: 19 time(s) in 13 post(s)
|
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 |
|
|
|
Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.