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!

sas-innovate-2026-white.png



April 27 – 30 | Gaylord Texan | Grapevine, Texas

Registration is open

Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!

Register now

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