23.06.2015 Views

MATLAB Programming

MATLAB Programming

MATLAB Programming

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

6 Data Import and Export<br />

m = memmapfile('records.dat', ...<br />

'Offset', 1024, ...<br />

'Format', {'uint32' [4 10 18] 'x'})<br />

m =<br />

Filename: 'd:\matlab\mfiles\records.dat'<br />

Writable: false<br />

Offset: 1024<br />

Format: {'uint32' [4 10 18] 'x'}<br />

Repeat: Inf<br />

Data: 13x1 struct array with fields:<br />

x<br />

A = m.Data(1).x;<br />

whos A<br />

Name Size Bytes Class<br />

A 4x10x18 2880 uint32 array<br />

Grand total is 720 elements using 2880 bytes<br />

You can change the data type, array shape, or field name that <strong>MATLAB</strong><br />

applies to the mapped region at any time by setting a new value for the<br />

Format property of the object:<br />

m.Format = {'uint64' [30 4 10] 'x'};<br />

A = m.Data(1).x;<br />

whos A<br />

Name Size Bytes Class<br />

A 30x4x10 9600 uint64 array<br />

Grand total is 1200 elements using 9600 bytes<br />

6-48

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!