Rank: Guest
Groups: Registered
Joined: 04/07/2015(UTC) Posts: 6,866 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 Utilities Matrix Mirror Exercise.sm (20kb) downloaded 20 time(s).
|
|
|
|
Rank: Administration Groups: Registered, Advanced Member Joined: 23/06/2009(UTC) Posts: 1,740 Was thanked: 318 time(s) in 268 post(s)
|
|
When Sisyphus climbed to the top of a hill, they said: "Wrong boulder!" |
|
|
|
Rank: Advanced Member Groups: Registered
Joined: 15/04/2012(UTC) Posts: 1,986 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 hereThe 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 |
|
1 user thanked mkraska for this useful post.
|
|
|
Rank: Advanced Member Groups: Registered
Joined: 17/01/2013(UTC) Posts: 296 Location: Khabarovsk, Russia Was thanked: 151 time(s) in 107 post(s)
|
Originally Posted by: mkraska 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) Edited by user 11 September 2016 11:13:28(UTC)
| Reason: Not specified |
Best regards, Mike Kaganski |
1 user thanked mikekaganski for this useful post.
|
|
|
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.