Hi tye,
I'm sorry, but it didn't work...
Just to make sure I understood correctly:
I changed the print line from this:
print ($h pack ('l5Z*d*', $type, $m, $n, $imag, $len, $name, @a));
to this:
print ($h pack ('l5Z*'.('Z*'x@s), $type, $m, $n, $imag, $len, $name, @a));
and from the main routine called:
mat4_write ('foo', 3, 1, ('aaa','bbb','ccc'), *MAT);
If you have another idea I would love to try it.
If not, I will give it up and save string arrays as their ascii numbers representations and convert back to strings inside matlab...
Thanks and good night,
Koby
p.s: Does Perl has a built-in function that converts a string to an array of its ascii numbers representation?
i.e.: 'ABC' -> (65,66,67)
| [reply] [d/l] [select] |
print $h pack 'l4 l/Z (Z*)*', $type, $m, $n, $imag, $name, @a;
Re: ascii string to characters—that's simple:
my @arr = unpack 'C*', $x;
| [reply] [d/l] [select] |
Re: ascii string to characters—that's simple: my @arr = unpack 'C*', $x;
Not if its packed with 'Z*'.
Plus: Your '(Z*)*' is no substitute for 'd*'. Remember the OP said that d* worked for arrays of less than 10 values.
Tye called it above with binmode; your addition is unnecessary and wrong.
With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.
| [reply] |
| [reply] |
In case this helps, here's the binary comparison between the file the Perl script created (on the left) and the file by matlab as a reference (on the right):
http://srv2.jpg.co.il/8/53d2ed38850fb.jpg
I'm going to sleep now,
it's really late here :)
Will return in the morning.
Thanks tye for all your help!
Koby
| [reply] |