Documentation

Memory Mapping

Map file data to memory for faster access

Memory-mapping is a mechanism that maps a file or a portion of a file on disk to a range of addresses within an application's address space. Use memory-mapping when you want to randomly access large files, or frequently access small files. In addition, memory-mapping lets you access file data using standard MATLAB®indexing operations. For more information, seeOverview of Memory-Mapping.

Functions

memmapfile Create memory map to a file

Examples and How To

Map File to Memory

Suppose you want to create a memory map for a file namedrecords.dat, using thememmapfilefunction.

Read from Mapped File

This example shows how to create two different memory maps, and then read from each of the maps using the appropriate syntax.

Write to Mapped File

This example shows how to create three different memory maps, and then write to each of the maps using the appropriate syntax.

Delete Memory Map

To clear amemmapfileobject from memory, do any of the following:

Share Memory Between Applications

This example shows how to implement two separate MATLAB processes that communicate with each other by writing and reading from a shared file.

Concepts

Overview of Memory-Mapping

Memory-mapping is a mechanism that maps a portion of a file, or an entire file, on disk to a range of addresses within an application's address space.