Products & Services Solutions Academia Support User Community Company

Learn more about Instrument Control Toolbox   

load - Load instrument objects and variables into MATLAB workspace

Syntax

load filename
load filename obj1 obj2 ...
out = load('filename','obj1','obj2',...)

Arguments

filename

The MAT-file name.

obj1 obj2 ...

Instrument objects or arrays of instrument objects.

out

A structure containing the specified instrument objects.

Description

load filename returns all variables from the MAT-file specified by filename into the MATLAB workspace.

load filename obj1 obj2 ... returns the instrument objects specified by obj1 obj2... from the MAT-file filename into the MATLAB workspace.

out = load('filename','obj1','obj2',...) returns the specified instrument objects from the MAT-file filename as a structure to out instead of directly loading them into the workspace. The field names in out match the names of the loaded instrument objects.

Remarks

Values for read-only properties are restored to their default values upon loading. For example, the Status property is restored to closed. To determine if a property is read-only, examine its reference pages or use the propinfo function.

Examples

Suppose you create the GPIB objects g1 and g2, configure a few properties for g1, and connect both objects to their associated instruments.

g1 = gpib('ni',0,1);
g2 = gpib('ni',0,2);
set(g1,'EOSMode','read','EOSCharCode','CR')
fopen([g1 g2])

The read-only Status property is automatically configured to open.

get([g1 g2],'Status')
ans = 
    'open'
    'open'

Save g1 and g2 to the file MyObject.mat, and then load the objects into the MATLAB workspace.

save MyObject g1 g2
load MyObject g1 g2

Values for read-only properties are restored to their default values upon loading, while all other property values are honored.

get([g1 g2],{'EOSMode','EOSCharCode','Status'})
ans = 
    'read'     'CR'     'closed'
    'none'     'LF'     'closed'

See Also

Functions

instrhelp, propinfo, save

  


Recommended Products

Includes the most popular MATLAB recorded presentations with Q&A sessions led by MATLAB experts.

 © 1984-2009- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS