MATLAB Function Reference |
Return memmapfile
object properties
Syntax
Description
s = get(obj)
returns the values of all properties of the memmapfile
object obj
in structure array s
. Each property retrieved from the object is represented by a field in the output structure. The name and contents of each field are the same as the name and value of the property it represents.
Note
Although property names of a memmapfile object are not case sensitive, field names of the output structure returned by get (named the same as the properties they represent) are case sensitive.
|
val = get(obj, prop)
returns the value(s) of one or more properties specified by prop
. The prop
input can be a quoted string or a cell array of quoted strings, each containing a property name. If the latter is true, get
returns the property values in a cell array.
Examples
You can use the get
method of the memmapfile
class to return information on any or all of the object's properties. Specify one or more property names to get the values of specific properties.
This example returns the values of the offset
, repeat
, and format
properties for a memmapfile
object. Start by constructing the object:
m = memmapfile('records.dat', 'offset', 2048, 'format', { ... 'int16' [2 2] 'model'; ... 'uint32' [1 1] 'serialno'; ... 'single' [1 3] 'expenses'});
Use the get
method to return the specified property values in a 1-by-3 cell array m_props
:
m_props = get(m, {'offset', 'repeat', 'format'}) m_props = [2048] [Inf] {3x3 cell} m_props{3} ans = 'int16' [1x2 double] 'model' 'uint32' [1x2 double] 'serialno' 'single' [1x2 double] 'expenses'
Another way to return the same information is to use the objname.property
syntax:
To return the values for all properties with get
, pass just the object name:
s = get(m) Filename: 'd:\matlab\mfiles\records.dat' Writable: 0 Offset: 2048 Format: {3x3 cell} Repeat: Inf Data: [753 1]
To see just the Format
field of the returned structure, type
s.Format ans = 'int16' [1x2 double] 'model' 'uint32' [1x2 double] 'serialno' 'single' [1x2 double] 'expenses'
See Also
getframe | getplottool |
© 1994-2005 The MathWorks, Inc.