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 Jean Giraud  
#1 Posted : 09 September 2016 15:29:52(UTC)
Jean Giraud

Rank: Guest

Groups: Registered
Joined: 04/07/2015(UTC)
Posts: 6,866
Canada

Was thanked: 981 time(s) in 809 post(s)
Smath does not support reverse cols order in "submatrix".
Alternately, here is the module. Read more in the attached.

Jean

Matrix Mirror.gif

Utilities Matrix Mirror Exercise.sm (20kb) downloaded 20 time(s).

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

Offline omorr  
#2 Posted : 09 September 2016 17:06:05(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)
I think this is remedied as well with the recent vector indices.
Moreover, I think we can forget about submatrix() function now

http://smath.info/cloud/worksheet/uRMs2euU

Regards,
Radovan

Edited by user 09 September 2016 17:09:02(UTC)  | Reason: Not specified

When Sisyphus climbed to the top of a hill, they said: "Wrong boulder!"
Offline mkraska  
#3 Posted : 09 September 2016 18:33:23(UTC)
mkraska


Rank: Advanced Member

Groups: Registered
Joined: 15/04/2012(UTC)
Posts: 1,986
Germany

Was thanked: 1124 time(s) in 721 post(s)
You even don't have to wait for the vector indices, at least for the mirror.

See here

index2.PNG

The mirror implementation is straightforward to understand (transpose, reverse, transpose)

The diagonal is a nasty indexing trick, which is that far from paper and pencil notation that it can't be recommended unless you want to obfuscate your algorithm (then best use excel). You just square the row/column index range elements to access the diagonal elements in linear indexing.
This, however, uses the vector index feature.

Edited by user 09 September 2016 18:35:03(UTC)  | Reason: Not specified

Martin Kraska

Pre-configured portable distribution of SMath Studio: https://smath.com/wiki/SMath_with_Plugins.ashx
thanks 1 user thanked mkraska for this useful post.
on 09/09/2016(UTC)
Offline mikekaganski  
#4 Posted : 10 September 2016 09:38:55(UTC)
mikekaganski


Rank: Advanced Member

Groups: Registered
Joined: 17/01/2013(UTC)
Posts: 296
Man
Russian Federation
Location: Khabarovsk, Russia

Was thanked: 151 time(s) in 107 post(s)
Originally Posted by: mkraska Go to Quoted Post
The diagonal is a nasty indexing trick, which is that far from paper and pencil notation that it can't be recommended unless you want to obfuscate your algorithm (then best use excel). You just square the row/column index range elements to access the diagonal elements in linear indexing.
This, however, uses the vector index feature.


diagonal(M):el(M,(range(0,(rows(M)-1)))*(rows(M)+1)+1)

diag.png

Edited by user 11 September 2016 11:13:28(UTC)  | Reason: Not specified

Best regards,
Mike Kaganski
thanks 1 user thanked mikekaganski for this useful post.
on 11/09/2016(UTC)
Users browsing this topic
Guest
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.