Memory Mapping
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
Suppose you want to create a memory map for a file namedrecords.dat
, using thememmapfile
function.
This example shows how to create two different memory maps, and then read from each of the maps using the appropriate syntax.
This example shows how to create three different memory maps, and then write to each of the maps using the appropriate syntax.
To clear amemmapfile
object 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
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.