John007 has asked for the wisdom of the Perl Monks concerning the following question:
Hello Monks !
Need help on below Math::MatrixReal module1) How to access an individual element and print it out of the final matrix <\p>
2) How to print final matrix in an Array so that I can use it later on for other purpose, printing to screen and also printing to a csv file
3) How to print final matrix in an Hash if 2D matrix so that I can print to screen and also save to CSV
Code =====use warnings; use strict; use Net::FTP; use Math::MatrixReal; print "\n Matrix from Arrays -Printing in ROWS format\n"; my @matrix1 = ( -0.022333, -0.016800, -0.016128, -0.015456, -0.014784, -0.014112, -0.013440, -0.012768, -0.012096, -0.011424 ); my @matrix2 = ( 3.36, 3.2, 3.35, 3.45, 3.55, 3.65, 3.75, 3.85, 3.95, 2.30 ); my $matrix_final = Math::MatrixReal->new_from_rows( [ \@matrix1, \@mat +rix2 ] ); print $matrix_final; my $matrix_transpose = Math::MatrixReal->new(10,2); $matrix_transpose->transpose($matrix_final); print $matrix_transpose;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: How to output matrix data from Math:;MatrixReal into a Hash or an Array
by wjw (Priest) on May 09, 2014 at 21:25 UTC | |
|
Re: How to output matrix data from Math:;MatrixReal into a Hash or an Array
by Laurent_R (Canon) on May 10, 2014 at 09:07 UTC | |
by John007 (Acolyte) on May 13, 2014 at 01:13 UTC | |
by davido (Cardinal) on May 13, 2014 at 01:56 UTC | |
by Laurent_R (Canon) on May 13, 2014 at 09:15 UTC | |
by davido (Cardinal) on May 13, 2014 at 13:58 UTC | |
| |
|
Re: How to output matrix data from Math:;MatrixReal into a Hash or an Array
by Laurent_R (Canon) on May 13, 2014 at 09:30 UTC |