in reply to Re^3: Write Matlab binary MAT-files from Perl (binmode)
in thread Write Matlab binary MAT-files from Perl

Thanks tye,
but excuse my ignorence,
how do I use the binmode...?

I've attached below the 'mat4_write' code.
Where should I tell it to use the binmode...?

Thanks,
Koby

sub mat4_write { # Variable name. my $name = shift; # Number of rows. my $m = shift; # Number of columns. my $n = shift; # Matrix elements in column major layout, this is the native # Matlab storage layout for matrices. my @a = splice (@_, 0, $m * $n); # File handle. my $h = shift; # Type flag. my $type = $mat4_type; # No imaginary part. my $imag = 0; # Length of variable name including terminating null character. my $len = length ($name) + 1; # Encode and print matrix. print ($h pack ('l5Z*d*', $type, $m, $n, $imag, $len, $name, @a)); }

Replies are listed 'Best First'.
Re^5: Write Matlab binary MAT-files from Perl (link)
by tye (Sage) on Jul 25, 2014 at 21:26 UTC

    Did you notice that the string "binmode" was underlined and of a different color in my reply above? Did you realize that this is a visual indication that it is a link that you can click on? Did you click on it? Did you read any of the information that then appeared?

    If you have questions related to that information, then I suspect somebody will be happy to answer them. (:

    - tye