Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Answer: How do I create a matrix?

by Beatnik (Parson)
on Jun 07, 2001 at 12:33 UTC ( #86494=categorized answer: print w/replies, xml ) Need Help??

Q&A > arrays > How do I create a matrix? - Answer contributed by Beatnik

You can use PDL::Matrix
#!/usr/bin/perl -w use strict; use PDL::Matrix; my $m = pdl [ [1,2,3], [4,5,6], [7,8,9] ];
Which then also allows you to perform clean, fast math on them.
my $m = pdl [ [1,2,3], [4,5,6], [7,8,9] ]; my $n = pdl [ [1,0,0], [0,1,0], [0,0,1] ]; my $r = $m x $n;

Log In?
Username:
Password:

What's my password?
Create A New User
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (5)
As of 2020-10-20 20:08 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My favourite web site is:












    Results (210 votes). Check out past polls.

    Notices?