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.

Accessing Files with Memory-Mapping<br />

Property Description Data Type Default<br />

Data<br />

Filename<br />

Format<br />

Offset<br />

Repeat<br />

Writable<br />

Contains the data read from the file or to be written<br />

tothefile. (See“ReadingaMappedFile”onpage<br />

6-54 and “Writing to a Mapped File” on page 6-59)<br />

Path and name of the file to map into memory. (See<br />

“SelectingtheFiletoMap”onpage6-43)<br />

Format of the contents of the mapped region,<br />

including data type, array shape, and variable<br />

or field name by which to access the data. (See<br />

“Identifying the Contents of the Mapped Region” on<br />

page 6-45)<br />

Number of bytes from the start of the file to the start<br />

of the mapped region. This number is zero-based.<br />

That is, offset 0 represents the start of the file. Must<br />

be a nonnegative integer value. (See “Setting the<br />

Start of the Mapped Region” on page 6-45)<br />

Number of times to apply the specified format to the<br />

mapped region of the file. Must be a positive integer<br />

value or Inf. (See “Repeating a Format Scheme” on<br />

page 6-52)<br />

Type of access allowed to the mapped region. Must<br />

be logical 1 or logical 0. (See “Setting the Type of<br />

Access” on page 6-53)<br />

Any of the<br />

numeric<br />

types<br />

char array<br />

char array<br />

or N-by-3<br />

cell array<br />

double 0<br />

double<br />

logical<br />

None<br />

None<br />

uint8<br />

Inf<br />

false<br />

You can set the values for any property except for Data atthetimeyoucall<br />

the memmapfile constructor, or at any time after that while the map is still<br />

valid. Any properties that are not explicitly set when you construct the object<br />

are given their default values as shown in the table above. For information on<br />

calling the constructor, see “Constructing a memmapfile Object” on page 6-40.<br />

Once a memmapfile object has been constructed, you can change the value of<br />

any of its properties. Use the objname.property syntax in assigning the new<br />

value. For example, to set a new Offset value for memory map object m, type<br />

m.Offset = 2048;<br />

6-39

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

Saved successfully!

Ooh no, something went wrong!