BookmarkSubscribeRSS Feed
bri11
Calcite | Level 5

so I've just been messing around trying to figure out how to write modules and I'm trying to create a module that will input three matrices that are all 3x3 and then returns the one with the largest determinant. So far I've just created a module that takes the determinant of whatever matrix I tell it too but I can't figure out how to do anything else.

proc iml;

start module(A, D);

      D= det(A);

finish;

*creating a matrices;

A = {5 8 1,

     2 6 4,

     6 6 6};

B = {5 8 9,

     2 4 1,

     2 2 2};

C = {4 4 4,

     9 8 7,

     3 3 3};

*calls the module from above;

run module(A, D);

print A;

print D;

run module(B, D);

print B;

print D;

run module(C, D);

print C;

print D;

1 REPLY 1
IanWakeling
Barite | Level 11

There is a very similar thread here:

https://communities.sas.com/message/209655

That you might want to look in to!

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

From The DO Loop
Want more? Visit our blog for more articles like these.
Discussion stats
  • 1 reply
  • 1062 views
  • 0 likes
  • 2 in conversation