Statistical programming, matrix languages, and more

creating a module

Reply
New Contributor
Posts: 3

creating a module

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;

Frequent Contributor
Posts: 143

Re: creating a module

There is a very similar thread here:

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

That you might want to look in to!

Ask a Question
Discussion stats
  • 1 reply
  • 257 views
  • 0 likes
  • 2 in conversation