<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/237743</link>
    <title>MATLAB Central Newsreader - fopen(machineformat=vaxd)</title>
    <description>Feed for thread: fopen(machineformat=vaxd)</description>
    <language>en-us</language>
    <copyright>&amp;copy;1994-2012 by MathWorks, Inc.</copyright>
    <webmaster>webmaster@mathworks.com</webmaster>
    <generator>MATLAB Central Newsreader</generator>
    <docs>http://blogs.law.harvard.edu/tech/rss</docs>
    <ttl>60</ttl>
    <image>
      <title>MathWorks</title>
      <url>http://www.mathworks.com/images/membrane_icon.gif</url>
    </image>
    <item>
      <pubDate>Sat, 18 Oct 2008 12:39:02 -0400</pubDate>
      <title>fopen(machineformat=vaxd)</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/237743#606029</link>
      <author>Jan Simon</author>
      <description>Dear users!&lt;br&gt;
&lt;br&gt;
I used the following command in Matlab 6.5 to open a file in Vax-D format:&lt;br&gt;
&amp;nbsp;&amp;nbsp;FID = fopen(FileName, Permission, 'd')&lt;br&gt;
&lt;br&gt;
This fails in Matlab R2008b, because the list of known machineformats has been reduced.&lt;br&gt;
&lt;br&gt;
1. When did this happen?&lt;br&gt;
2. I've tried a lot of searching on www.mathworks.com without success - what a the right terms for searching?&lt;br&gt;
3. How do I read the files written in VAXD format?&lt;br&gt;
&lt;br&gt;
Thanks, Jan</description>
    </item>
    <item>
      <pubDate>Sat, 18 Oct 2008 17:41:02 -0400</pubDate>
      <title>Re: fopen(machineformat=vaxd)</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/237743#606063</link>
      <author>James Tursa</author>
      <description>&quot;Jan Simon&quot; &amp;lt;matlab.THIS_YEAR@nMINUSsimon.de&amp;gt; wrote in message &amp;lt;gdcld5$2jj$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; Dear users!&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; I used the following command in Matlab 6.5 to open a file in Vax-D format:&lt;br&gt;
&amp;gt;   FID = fopen(FileName, Permission, 'd')&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; This fails in Matlab R2008b, because the list of known machineformats has been reduced.&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; 1. When did this happen?&lt;br&gt;
&amp;gt; 2. I've tried a lot of searching on www.mathworks.com without success - what a the right terms for searching?&lt;br&gt;
&amp;gt; 3. How do I read the files written in VAXD format?&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Thanks, Jan&lt;br&gt;
&lt;br&gt;
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 D-FLOAT numbers? How many per record? What system are you reading these on? Do you know if your system is big-endian or little-endian?&lt;br&gt;
&lt;br&gt;
James Tursa</description>
    </item>
    <item>
      <pubDate>Sat, 18 Oct 2008 22:21:01 -0400</pubDate>
      <title>Re: fopen(machineformat=vaxd)</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/237743#606078</link>
      <author>James Tursa</author>
      <description>&amp;gt; &quot;Jan Simon&quot; &amp;lt;matlab.THIS_YEAR@nMINUSsimon.de&amp;gt; wrote in message &amp;lt;gdcld5$2jj$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; &amp;gt; Dear users!&lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; I used the following command in Matlab 6.5 to open a file in Vax-D format:&lt;br&gt;
&amp;gt; &amp;gt;   FID = fopen(FileName, Permission, 'd')&lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; This fails in Matlab R2008b, because the list of known machineformats has been reduced.&lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; 1. When did this happen?&lt;br&gt;
&lt;br&gt;
FYI, it was available in 2008a (along with VAXG), but was dropped from 2008b for some reason.&lt;br&gt;
&amp;nbsp;&lt;br&gt;
&amp;nbsp;James Tursa</description>
    </item>
    <item>
      <pubDate>Sat, 18 Oct 2008 23:06:01 -0400</pubDate>
      <title>Re: fopen(machineformat=vaxd)</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/237743#606082</link>
      <author>Jan Simon</author>
      <description>Thanks James!&lt;br&gt;
&amp;nbsp;&lt;br&gt;
&amp;gt; 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 D-FLOAT numbers? How many per record? What system are you reading these on? Do you know if your system is big-endian or little-endian?&lt;br&gt;
&lt;br&gt;
It would be a big hack! I'm working with C3D files, which contain a section with mixed CHAR, INT8, UINT16, FLOAT32.&lt;br&gt;
Afterwards a big block of binary records is following and finally **any** kind of supplemental data are allowed.&lt;br&gt;
&lt;br&gt;
I have about trial 20.000 files and assume 20% of them use the VaxD format.&lt;br&gt;
&lt;br&gt;
I'm enormously surprised that Matlab has removed this important feature from FOPEN! It worked since Matlab 4 (or even earlier), you find the VAXD-Format 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?&lt;br&gt;
&lt;br&gt;
So the best solution for me would be a conversion in 6.5.1: Read in VAXD and develop a function to write in little-endian. That's no fun.&lt;br&gt;
&lt;br&gt;
Kind regards, Jan</description>
    </item>
    <item>
      <pubDate>Sat, 18 Oct 2008 23:34:01 -0400</pubDate>
      <title>Re: fopen(machineformat=vaxd)</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/237743#606083</link>
      <author>Jan Simon</author>
      <description>Google found out, that R2007 had the VAXD format for FOPEN.&lt;br&gt;
Python use it also.&lt;br&gt;
Waiting for ideas, Jan</description>
    </item>
    <item>
      <pubDate>Sun, 19 Oct 2008 15:59:47 -0400</pubDate>
      <title>Re: fopen(machineformat=vaxd)</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/237743#606151</link>
      <author>James Tursa</author>
      <description>On Sat, 18 Oct 2008 23:06:01 +0000 (UTC), &quot;Jan Simon&quot;&lt;br&gt;
&amp;lt;matlab.THIS_YEAR@nMINUSsimon.de&amp;gt; wrote:&lt;br&gt;
&lt;br&gt;
&amp;gt;Thanks James!&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt;&amp;gt; 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 D-FLOAT numbers? How many per record? What system are you reading these on? Do you know if your system is big-endian or little-endian?&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt;It would be a big hack!&lt;br&gt;
&lt;br&gt;
I don't think so. At least not based on what you have written so far.&lt;br&gt;
&lt;br&gt;
&amp;gt;I'm working with C3D files, which contain a section with mixed CHAR, INT8, UINT16, FLOAT32.&lt;br&gt;
&amp;gt;Afterwards a big block of binary records is following and finally **any** kind of supplemental data are allowed.&lt;br&gt;
&amp;gt;&lt;br&gt;
&lt;br&gt;
I am assuming you can still open and read the files, and most of the&lt;br&gt;
data (i.e., the CHAR, INT8, etc.) still reads in OK as long as you get&lt;br&gt;
the endian stuff correct. It sounds like your only real problem is the&lt;br&gt;
VAXD floating point format. My strategy would be to simply read these&lt;br&gt;
values in as double, int64, or uint64 bit patterns, and then write a&lt;br&gt;
little conversion function.&lt;br&gt;
&lt;br&gt;
I notice you have FLOAT32 above. This would be a single precision&lt;br&gt;
F_FLOAT format, not a double precision D_FLOAT format. Are you reading&lt;br&gt;
in single precision 32-bit floating point numbers, or double precision&lt;br&gt;
64-bit floating point numbers? F_FLOAT numbers are actually easy to&lt;br&gt;
convert to IEEE single once you get the endian correct ... just divide&lt;br&gt;
what you read in by 4.&lt;br&gt;
&lt;br&gt;
&amp;gt;I have about trial 20.000 files and assume 20% of them use the VaxD format.&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt;I'm enormously surprised that Matlab has removed this important feature from FOPEN! It worked since Matlab 4 (or even earlier), you find the VAXD-Format in Octave and Scilab.&lt;br&gt;
&lt;br&gt;
Curious. Why would they delete a capability? I don't know.&lt;br&gt;
&lt;br&gt;
&amp;gt; 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?&lt;br&gt;
&amp;gt;&lt;br&gt;
&lt;br&gt;
I don't believe The Mathworks has any documentation online for former&lt;br&gt;
releases, unfortunately.&lt;br&gt;
&lt;br&gt;
&amp;gt;So the best solution for me would be a conversion in 6.5.1: Read in VAXD and develop a function to write in little-endian. That's no fun.&lt;br&gt;
&amp;gt;&lt;br&gt;
&lt;br&gt;
Actually, the endian stuff is easy ... just do some byte swapping. It&lt;br&gt;
is the conversion of VAXD (8 bit exponent, 55 bit mantissa) to IEEE&lt;br&gt;
double (11 bit exponent, 52 bit mantissa) that is a bit tricky (mostly&lt;br&gt;
the rounding), but I don't think it would be too difficult.&lt;br&gt;
&lt;br&gt;
James Tursa</description>
    </item>
    <item>
      <pubDate>Sun, 19 Oct 2008 16:28:44 -0400</pubDate>
      <title>Simulink</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/237743#606154</link>
      <author>Aung Shane</author>
      <description>Hi Users,&lt;br&gt;
&lt;br&gt;
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.&lt;br&gt;
&lt;br&gt;
With Regards</description>
    </item>
    <item>
      <pubDate>Mon, 20 Oct 2008 01:11:01 -0400</pubDate>
      <title>Re: fopen(machineformat=vaxd)</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/237743#606216</link>
      <author>James Tursa</author>
      <description>&quot;Jan Simon&quot; &amp;lt;matlab.THIS_YEAR@nMINUSsimon.de&amp;gt; wrote in message &amp;lt;gddq4p$k2t$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; Thanks James!&lt;br&gt;
&amp;gt;  &lt;br&gt;
&amp;gt; &amp;gt; 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 D-FLOAT numbers? How many per record? What system are you reading these on? Do you know if your system is big-endian or little-endian?&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; It would be a big hack!&lt;br&gt;
&lt;br&gt;
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.&lt;br&gt;
&lt;br&gt;
&amp;gt; I'm working with C3D files, which contain a section with mixed CHAR, INT8, UINT16, FLOAT32.&lt;br&gt;
&amp;gt; Afterwards a big block of binary records is following and finally **any** kind of supplemental data are allowed.&lt;br&gt;
&amp;gt; &lt;br&gt;
&lt;br&gt;
The only problem you seem to have is the D-FLOAT stuff. &lt;br&gt;
All of the other variables I assume you can still read &lt;br&gt;
in OK, as long as you get the endian convention OK. &lt;br&gt;
The strategy I am proposing is to pick the appropriate &lt;br&gt;
endian for fopen, then read in the data using fread. &lt;br&gt;
The D-FLOAT stuff will of course read incorrectly as &lt;br&gt;
an IEEE double, but I can write a function to manipulate &lt;br&gt;
the bits after you read in the value to convert them &lt;br&gt;
from a D-FLOAT format to an IEEE double format. I am &lt;br&gt;
quite familiar with both and this should not be too &lt;br&gt;
difficult. D-FLOAT only has 8 bits for exponent and &lt;br&gt;
55 bits for mantissa, whereas IEEE double has 11 bits &lt;br&gt;
for exponent and 52 bits for mantissa. The range of &lt;br&gt;
a D-FLOAT is less than a IEEE double, so the only tricky &lt;br&gt;
part will be the rounding from 55 bit mantissa down &lt;br&gt;
to a 52 bit mantissa. If MATLAB somehow screws up the &lt;br&gt;
floating point bits on the fread operation so you don't &lt;br&gt;
get the exact bit pattern on the fread, you could always &lt;br&gt;
read them in as int64 or uint64 and then do the bit &lt;br&gt;
conversion on that instead. &lt;br&gt;
&lt;br&gt;
Alternatively, you could read in the file in native format, and then use swapbytes to do the endian stuff manually.&lt;br&gt;
&lt;br&gt;
Just to be clear, D-FLOAT is a 64-bit double precision floating point format, whereas F-FLOAT is a 32-bit single precision floating point format. You wrote FLOAT32 above. Was this what you are assuming is D-FLOAT?&lt;br&gt;
&lt;br&gt;
&amp;gt; I have about trial 20.000 files and assume 20% of them use the VaxD format.&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; I'm enormously surprised that Matlab has removed this important feature from FOPEN! It worked since Matlab 4 (or even earlier), you find the VAXD-Format in Octave and Scilab. Unfortunately, I cannot find any documentation for this loss of features on the Mathworks web docs.&lt;br&gt;
&lt;br&gt;
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 &amp; run so I can generate some test files on my own?&lt;br&gt;
&lt;br&gt;
&amp;gt; By the way, where do I find the documentation for former releases?&lt;br&gt;
&amp;gt;&lt;br&gt;
&lt;br&gt;
I don't think they maintain documentation for past releases on their website.&lt;br&gt;
&amp;nbsp;&lt;br&gt;
&amp;gt; So the best solution for me would be a conversion in 6.5.1: Read in VAXD and develop a function to write in little-endian. That's no fun.&lt;br&gt;
&amp;gt; &lt;br&gt;
&lt;br&gt;
The endian part is the easy part.&lt;br&gt;
&lt;br&gt;
James Tursa</description>
    </item>
  </channel>
</rss>

