in reply to Convert Column Matrix into Row Matrix using Math::MatrixReal
I have not used Math::MatrixReal before and am press for time to go through it now, but am sure the module can convert from column to row. If so, prepare your data in the way you wanted like so:
and make the the module do the rest.use warnings; use strict; use Data::Dumper; my $mref = [ [ '5', '4', '4', '2', '4' ],]; my @data; for (@$mref){ push @data, map {[$_]} @{$_} } print Dumper \@data;
However, if the module does this, it might be cleaner and perhaps faster.$VAR1 = [ [ '5' ], [ '4' ], [ '4' ], [ '2' ], [ '4' ] ];
|
|---|