Hmm, not using your module, you could try something simple in the spirit of this code under the debugger.
DB<2> $mref = [ qw / 5 4 4 2 4/ ]; DB<3> x \$mref 0 REF(0x600500ac8) -> ARRAY(0x600509918) 0 5 1 4 2 4 3 2 4 4 DB<4> $nref = [ map {[$_]} @$mref ]; DB<5> x \$nref 0 REF(0x600500708) -> ARRAY(0x6005e8c88) 0 ARRAY(0x6005ea970) 0 5 1 ARRAY(0x6005f3d20) 0 4 2 ARRAY(0x6004bdfd0) 0 4 3 ARRAY(0x60060d270) 0 2 4 ARRAY(0x6005e8c40) 0 4
Note that I used an simple arrayref as source data, as I did not see the reason to have an array ref to an array ref if the first array as only one element. But that is quite easy to change if this is really what you need.

Edit: The post by 2teez below reminded me that the Data Dumper module gives an output somewhat cleaner than the x function of the debugger. Since I had still my debugging screen as above, with the data structures still there, this is the data dumper output:

DB<6> use Data::Dumper; DB<7> print Dumper \$nref $VAR1 = \[ [ '5' ], [ '4' ], [ '4' ], [ '2' ], [ '4' ] ];

And if the input data structure is really a ref to an AoA, the code can be changed as follows:

DB<8> $mref = [ [ qw / 5 4 4 2 4/ ], ]; DB<9> $nref = [ map {[$_]} map {@{$_}} @$mref ];
producing the same resulting data structure and output as above.

In reply to Re: Convert Column Matrix into Row Matrix using Math::MatrixReal by Laurent_R
in thread Convert Column Matrix into Row Matrix using Math::MatrixReal by John007

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.