http://www.mathworks.com/matlabcentral/newsreader/view_thread/237743
MATLAB Central Newsreader  fopen(machineformat=vaxd)
Feed for thread: fopen(machineformat=vaxd)
enus
©19942014 by MathWorks, Inc.
webmaster@mathworks.com
MATLAB Central Newsreader
http://blogs.law.harvard.edu/tech/rss
60
MathWorks
http://www.mathworks.com/images/membrane_icon.gif

Sat, 18 Oct 2008 12:39:02 +0000
fopen(machineformat=vaxd)
http://www.mathworks.com/matlabcentral/newsreader/view_thread/237743#606029
Jan Simon
Dear users!<br>
<br>
I used the following command in Matlab 6.5 to open a file in VaxD format:<br>
FID = fopen(FileName, Permission, 'd')<br>
<br>
This fails in Matlab R2008b, because the list of known machineformats has been reduced.<br>
<br>
1. When did this happen?<br>
2. I've tried a lot of searching on www.mathworks.com without success  what a the right terms for searching?<br>
3. How do I read the files written in VAXD format?<br>
<br>
Thanks, Jan

Sat, 18 Oct 2008 17:41:02 +0000
Re: fopen(machineformat=vaxd)
http://www.mathworks.com/matlabcentral/newsreader/view_thread/237743#606063
James Tursa
"Jan Simon" <matlab.THIS_YEAR@nMINUSsimon.de> wrote in message <gdcld5$2jj$1@fred.mathworks.com>...<br>
> Dear users!<br>
> <br>
> I used the following command in Matlab 6.5 to open a file in VaxD format:<br>
> FID = fopen(FileName, Permission, 'd')<br>
> <br>
> This fails in Matlab R2008b, because the list of known machineformats has been reduced.<br>
> <br>
> 1. When did this happen?<br>
> 2. I've tried a lot of searching on www.mathworks.com without success  what a the right terms for searching?<br>
> 3. How do I read the files written in VAXD format?<br>
> <br>
> Thanks, Jan<br>
<br>
I may be able to write some custom code for you ... I just did something similar on another newsgroup thread recently. Is the file just a pure binary file with only DFLOAT numbers? How many per record? What system are you reading these on? Do you know if your system is bigendian or littleendian?<br>
<br>
James Tursa

Sat, 18 Oct 2008 22:21:01 +0000
Re: fopen(machineformat=vaxd)
http://www.mathworks.com/matlabcentral/newsreader/view_thread/237743#606078
James Tursa
> "Jan Simon" <matlab.THIS_YEAR@nMINUSsimon.de> wrote in message <gdcld5$2jj$1@fred.mathworks.com>...<br>
> > Dear users!<br>
> > <br>
> > I used the following command in Matlab 6.5 to open a file in VaxD format:<br>
> > FID = fopen(FileName, Permission, 'd')<br>
> > <br>
> > This fails in Matlab R2008b, because the list of known machineformats has been reduced.<br>
> > <br>
> > 1. When did this happen?<br>
<br>
FYI, it was available in 2008a (along with VAXG), but was dropped from 2008b for some reason.<br>
<br>
James Tursa

Sat, 18 Oct 2008 23:06:01 +0000
Re: fopen(machineformat=vaxd)
http://www.mathworks.com/matlabcentral/newsreader/view_thread/237743#606082
Jan Simon
Thanks James!<br>
<br>
> I may be able to write some custom code for you ... I just did something similar on another newsgroup thread recently. Is the file just a pure binary file with only DFLOAT numbers? How many per record? What system are you reading these on? Do you know if your system is bigendian or littleendian?<br>
<br>
It would be a big hack! I'm working with C3D files, which contain a section with mixed CHAR, INT8, UINT16, FLOAT32.<br>
Afterwards a big block of binary records is following and finally **any** kind of supplemental data are allowed.<br>
<br>
I have about trial 20.000 files and assume 20% of them use the VaxD format.<br>
<br>
I'm enormously surprised that Matlab has removed this important feature from FOPEN! It worked since Matlab 4 (or even earlier), you find the VAXDFormat in Octave and Scilab. Unfortunately, I cannot find any documentation for this loss of features on the Mathworks web docs. By the way, where do I find the documentation for former releases?<br>
<br>
So the best solution for me would be a conversion in 6.5.1: Read in VAXD and develop a function to write in littleendian. That's no fun.<br>
<br>
Kind regards, Jan

Sat, 18 Oct 2008 23:34:01 +0000
Re: fopen(machineformat=vaxd)
http://www.mathworks.com/matlabcentral/newsreader/view_thread/237743#606083
Jan Simon
Google found out, that R2007 had the VAXD format for FOPEN.<br>
Python use it also.<br>
Waiting for ideas, Jan

Sun, 19 Oct 2008 15:59:47 +0000
Re: fopen(machineformat=vaxd)
http://www.mathworks.com/matlabcentral/newsreader/view_thread/237743#606151
James Tursa
On Sat, 18 Oct 2008 23:06:01 +0000 (UTC), "Jan Simon"<br>
<matlab.THIS_YEAR@nMINUSsimon.de> wrote:<br>
<br>
>Thanks James!<br>
> <br>
>> I may be able to write some custom code for you ... I just did something similar on another newsgroup thread recently. Is the file just a pure binary file with only DFLOAT numbers? How many per record? What system are you reading these on? Do you know if your system is bigendian or littleendian?<br>
><br>
>It would be a big hack!<br>
<br>
I don't think so. At least not based on what you have written so far.<br>
<br>
>I'm working with C3D files, which contain a section with mixed CHAR, INT8, UINT16, FLOAT32.<br>
>Afterwards a big block of binary records is following and finally **any** kind of supplemental data are allowed.<br>
><br>
<br>
I am assuming you can still open and read the files, and most of the<br>
data (i.e., the CHAR, INT8, etc.) still reads in OK as long as you get<br>
the endian stuff correct. It sounds like your only real problem is the<br>
VAXD floating point format. My strategy would be to simply read these<br>
values in as double, int64, or uint64 bit patterns, and then write a<br>
little conversion function.<br>
<br>
I notice you have FLOAT32 above. This would be a single precision<br>
F_FLOAT format, not a double precision D_FLOAT format. Are you reading<br>
in single precision 32bit floating point numbers, or double precision<br>
64bit floating point numbers? F_FLOAT numbers are actually easy to<br>
convert to IEEE single once you get the endian correct ... just divide<br>
what you read in by 4.<br>
<br>
>I have about trial 20.000 files and assume 20% of them use the VaxD format.<br>
><br>
>I'm enormously surprised that Matlab has removed this important feature from FOPEN! It worked since Matlab 4 (or even earlier), you find the VAXDFormat in Octave and Scilab.<br>
<br>
Curious. Why would they delete a capability? I don't know.<br>
<br>
> Unfortunately, I cannot find any documentation for this loss of features on the Mathworks web docs. By the way, where do I find the documentation for former releases?<br>
><br>
<br>
I don't believe The Mathworks has any documentation online for former<br>
releases, unfortunately.<br>
<br>
>So the best solution for me would be a conversion in 6.5.1: Read in VAXD and develop a function to write in littleendian. That's no fun.<br>
><br>
<br>
Actually, the endian stuff is easy ... just do some byte swapping. It<br>
is the conversion of VAXD (8 bit exponent, 55 bit mantissa) to IEEE<br>
double (11 bit exponent, 52 bit mantissa) that is a bit tricky (mostly<br>
the rounding), but I don't think it would be too difficult.<br>
<br>
James Tursa

Sun, 19 Oct 2008 16:28:44 +0000
Simulink
http://www.mathworks.com/matlabcentral/newsreader/view_thread/237743#606154
Aung Shane
Hi Users,<br>
<br>
I have some difficulties (1)using FFTScope to view the power spectral denisty of my signal. I am seeing the high dB value (2) not able to generate high frequency noise somewhere around 200kHz. Tried generate using the noise generator in the simulink but not working. Pls kindly help me on this.<br>
<br>
With Regards

Mon, 20 Oct 2008 01:11:01 +0000
Re: fopen(machineformat=vaxd)
http://www.mathworks.com/matlabcentral/newsreader/view_thread/237743#606216
James Tursa
"Jan Simon" <matlab.THIS_YEAR@nMINUSsimon.de> wrote in message <gddq4p$k2t$1@fred.mathworks.com>...<br>
> Thanks James!<br>
> <br>
> > I may be able to write some custom code for you ... I just did something similar on another newsgroup thread recently. Is the file just a pure binary file with only DFLOAT numbers? How many per record? What system are you reading these on? Do you know if your system is bigendian or littleendian?<br>
> <br>
> It would be a big hack!<br>
<br>
I don't think so. At least not based on what you have written so far. Like I wrote earlier, I have already done something very similar quite recently.<br>
<br>
> I'm working with C3D files, which contain a section with mixed CHAR, INT8, UINT16, FLOAT32.<br>
> Afterwards a big block of binary records is following and finally **any** kind of supplemental data are allowed.<br>
> <br>
<br>
The only problem you seem to have is the DFLOAT stuff. <br>
All of the other variables I assume you can still read <br>
in OK, as long as you get the endian convention OK. <br>
The strategy I am proposing is to pick the appropriate <br>
endian for fopen, then read in the data using fread. <br>
The DFLOAT stuff will of course read incorrectly as <br>
an IEEE double, but I can write a function to manipulate <br>
the bits after you read in the value to convert them <br>
from a DFLOAT format to an IEEE double format. I am <br>
quite familiar with both and this should not be too <br>
difficult. DFLOAT only has 8 bits for exponent and <br>
55 bits for mantissa, whereas IEEE double has 11 bits <br>
for exponent and 52 bits for mantissa. The range of <br>
a DFLOAT is less than a IEEE double, so the only tricky <br>
part will be the rounding from 55 bit mantissa down <br>
to a 52 bit mantissa. If MATLAB somehow screws up the <br>
floating point bits on the fread operation so you don't <br>
get the exact bit pattern on the fread, you could always <br>
read them in as int64 or uint64 and then do the bit <br>
conversion on that instead. <br>
<br>
Alternatively, you could read in the file in native format, and then use swapbytes to do the endian stuff manually.<br>
<br>
Just to be clear, DFLOAT is a 64bit double precision floating point format, whereas FFLOAT is a 32bit single precision floating point format. You wrote FLOAT32 above. Was this what you are assuming is DFLOAT?<br>
<br>
> I have about trial 20.000 files and assume 20% of them use the VaxD format.<br>
> <br>
> I'm enormously surprised that Matlab has removed this important feature from FOPEN! It worked since Matlab 4 (or even earlier), you find the VAXDFormat in Octave and Scilab. Unfortunately, I cannot find any documentation for this loss of features on the Mathworks web docs.<br>
<br>
Yes, this is a bit surprising. Since they already had this capability, why give it up? I am not familiar with Octave or Scilab. Are they easy to install & run so I can generate some test files on my own?<br>
<br>
> By the way, where do I find the documentation for former releases?<br>
><br>
<br>
I don't think they maintain documentation for past releases on their website.<br>
<br>
> So the best solution for me would be a conversion in 6.5.1: Read in VAXD and develop a function to write in littleendian. That's no fun.<br>
> <br>
<br>
The endian part is the easy part.<br>
<br>
James Tursa