02-04-2009 03:14 AM
Hi all,
I'm using a MathScript node to read contents from a file. The binary data is stored as big-endian floats, but I only figured out how to read little-endian data.
In Matlab you can specifiy the number formatting when opening a file using fopen. In MathScript I didn't see any option for that, neither in fopen nor in fread. Is there a way to read big-endian floating point data?
Second question, I use a switch/case statement. In Matlab I can specify lists of items to match in a case, is there a way to do this in MathScript?
Something like this (a is a string):
switch a
case {'a', 'b'}
...
Thanks,
Daniel
02-04-2009 09:23 AM
02-04-2009 09:31 AM
Hi Grant,
Thanks for the information.
That's what I did with the cases, duplicating the options.
Unfortunately I didn't find a suitable workaround for reading big-endian data yet. Probably read as string, shuffle the bytes accordingly and transform into float... I'll have to try.
Thanks,
Daniel