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 TheWizEd  
#1 Posted : 07 June 2011 23:42:38(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)
I was curious how to embed matrices in a matrix and access an element of it.

X[2 gives me the second row matrix.

(X[2)[1,2 gives me the middle element of the second row.

Works with functions too.

Open in SMath Cloud
Ed

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

Offline omorr  
#2 Posted : 08 June 2011 09:36:28(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 Ed,

Yes, that is possible in SMath. One can have nested-embedded matrices. Andrey introduced that in one of the previous releases. I think he intended to apply some operations with so called "block matrices". It seems that there is some additional work to be done regarding this. It depends on Andrey's opinion about that.
For instance, take a closer look to this example.
Open in SMath Cloud
Did you notice how transpose operator works with nested matrices?
On the other hand, we should take care of the multiple indexing here in order not to make mistakes.

Regards,
Radovan

Edited by user 08 June 2011 15:00:35(UTC)  | Reason: Not specified

When Sisyphus climbed to the top of a hill, they said: "Wrong boulder!"
thanks 1 user thanked omorr for this useful post.
on 08/06/2011(UTC)
Offline TheWizEd  
#3 Posted : 08 June 2011 19:31:49(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)
Radovan,

I'm not able to sub element an element thats why I found I had to enclose the submatrix in parens (X.2)[1,2 to get it to work. I'm using 0.89. Perhaps in the beta versions you can sub element an elemnt of a matrix X[2[1,2.
Ed
Offline omorr  
#4 Posted : 08 June 2011 22:49:32(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 Ed,

At the moment, we should take care when using this multiple indexing. You could use parenthesis, but you do not need to do that if you use space key {SPACE}. For instance you should use X[2{SPACE}[1,2 instead of X[2[1,2. If we do not take care of this {SPACE} thing, there would actually error be issued - sometimes a strange one, for instance - that we try to display some large or small number not supported by Int32 ??? . There would be no problem as long as we use {SPACE} to enclose the needed parts of the variable inside the editing line (where invisible parenthesis would actually be). As I said, I think there are some additional efforts needed by Andrey to resolve these ambiguities.

I hope I made myself understood. If not I would give some pictures in the subsequnt posts (not able at the moment).

Regards,
Radovan
When Sisyphus climbed to the top of a hill, they said: "Wrong boulder!"
Offline TheWizEd  
#5 Posted : 09 June 2011 02:15:22(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)
Radovan,

I tried your {SPACE} and it works with 0.89 Stable. I didn't know about this. Thanks.
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.