|
|
| Author |
Message |
Guest
|
Posted: Tue Apr 29, 2008 8:46 am Post subject: mat file format |
|
|
What is the *.mat file format ?
jlm |
|
| Back to top |
|
 |
picojohn Site Admin

Joined: 11 Jun 2007
Posts: 391
|
Posted: Tue Apr 29, 2008 10:14 am Post subject: |
|
|
Hello Jim,
That is a file format for Matlab 4.
Regards
John |
|
| Back to top |
|
 |
Guest
|
Posted: Sat May 10, 2008 5:33 am Post subject: |
|
|
Oh !
I am not stupide (sory)
but precisly can you describe this file format ?
jlm |
|
| Back to top |
|
 |
markB Site Admin

Joined: 27 Mar 2007
Posts: 80
Location: Cambridgeshire,UK
|
Posted: Mon May 12, 2008 12:24 pm Post subject: |
|
|
Section 6 of the PicoScope manual decribes the file format. Here is a brief summary:
The header
The file consists of a number of data blocks preceded by 20-byte headers. Each header contains five 32-bit integers (as described in the table below).
Bytes Value
0 – 3 Data format (0, 10 or 20)
4 – 7 Number of values
8 – 11 1
12 – 15 0
16 – 19 Name length
Data format
The ‘Data format’ in the first 4-bytes describes the type of numerical data in the array.
Value Description
0 Double (64-bit floating point)
10 Single (32-bit floating point)
20 Integer (32-bit)
Number of values
The ‘Number of values’ is a 32-bit integer describing the number of numerical values in the array. This value may be 1 for variables that only describe one value; but for arrays of samples or times, expect this to be a large number.
Name length
The ‘Name length’ is the length of the name of the variable as a null-terminated 1-byte per character ASCII string. The last null terminating character (‘\0’) is included in the ‘Name length’ so if the variable name is “TStart” (same as ‘TStart\0’) then the name length will be 7.
The data block
The data block begins with the name of the variable (such as A, Tinterval) and you should read in the number of bytes described by the ‘Name length’ part of the header (not forgetting that the last byte in the string is ‘\0’ if your programming language needs to take account of this).
The remaining part of the data block is the actual data itself, so read in the number of values described in the ‘Number of values’ part of the header. Remember to take account of the size of each value as described in the ‘Data format’ part of the header.
Channel data such as voltages, in variables such as A and B, are stored as 32-bit single-precision floating-point data types. Times such as Tstart, Tinterval and T are stored as 64-bit double. Tlength is stored as a
32-bit integer. |
|
| Back to top |
|
 |
|
Powered by phpBB © 2001, 2005 phpBB Group
|