Welcome Guest! To enable all features please Login. New Registrations are disabled.

Notification

Icon
Error

Login


Options
Go to last post Go to first unread
Offline felted  
#1 Posted : 17 February 2011 19:05:17(UTC)
felted

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

Wanna join the discussion?! Login to your SMath Studio Forum forum account. New Registrations are disabled.

Offline omorr  
#2 Posted : 17 February 2011 20:12:34(UTC)
omorr


Rank: Administration

Groups: Registered, Advanced Member
Joined: 23/06/2009(UTC)
Posts: 1,740
Man
Serbia

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!"
Offline TheWizEd  
#3 Posted : 18 February 2011 02:03:43(UTC)
TheWizEd


Rank: Advanced Member

Groups: Registered
Joined: 04/07/2010(UTC)
Posts: 178
Man
United States

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
Offline felted  
#4 Posted : 18 February 2011 14:44:13(UTC)
felted

Rank: Newbie

Groups: Registered
Joined: 17/02/2011(UTC)
Posts: 2

Hm, but here http://en.smath.info/for...osts&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

Edited by user 18 February 2011 14:57:14(UTC)  | Reason: Not specified

Offline omorr  
#5 Posted : 18 February 2011 21:53:43(UTC)
omorr


Rank: Administration

Groups: Registered, Advanced Member
Joined: 23/06/2009(UTC)
Posts: 1,740
Man
Serbia

Was thanked: 318 time(s) in 268 post(s)
Hello Felted,
felted wrote:
Hm, but here http://en.smath.info/for...osts&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:
ABC.abc←10
Type: Fun.xy(x,y):x^2[SPACE]+y^2
See:
Fun.xy(x,y)←x^2+y^2

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.)
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)=6
More examples:
Fun.xy(x)←mat(x,x^2,x^3,3,1)
el(Fun.xy(2),3)=8

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!"
Offline TheWizEd  
#6 Posted : 19 February 2011 17:57:08(UTC)
TheWizEd


Rank: Advanced Member

Groups: Registered
Joined: 04/07/2010(UTC)
Posts: 178
Man
United States

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
Users browsing this topic
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.