| Data Acquisition Toolbox™ | ![]() |
load file
load file obj1 obj2. . .
out = load('file','obj1','obj2',. . .)
file | The MAT-file name. |
obj1 obj2... | Device objects, an array of device objects, channels, or lines. |
out | A structure containing the loaded device objects. |
load file returns all variables from the MAT-file file into the MATLAB workspace.
load file obj1 obj2... returns the specified device objects from the MAT-file file into the MATLAB workspace.
out = load('file','obj1','obj2',...) returns the specified device objects from the MAT-file file as a structure to out instead of directly loading them into the workspace. The field names in out match the names of the loaded device objects. If no device objects are specified, then all variables existing in the MAT-file are loaded.
Loading device objects follows these rules:
Unique device objects are loaded into the MATLAB workspace as well as the engine.
If a loaded device object already exists in the engine but not the MATLAB workspace, the loaded device object automatically reconnects to the engine device object.
If a loaded device object already exists in the workspace or the engine but has different properties than the loaded object, then these rules are followed:
The read-only properties are automatically reset to their default values.
All other property values are given by the loaded object and a warning is issued stating that property values of the workspace object have been updated.
If the workspace device object is running, then it is stopped before loading occurs.
If identical device objects are loaded, then they point to the same device object in the engine. For example, if you saved the array
x = [ai1 ai1 ai2]
only ai1 and ai2 are created in the engine, and x(1) will equal x(2).
Values for read-only properties are restored to their default values upon loading. For example, the EventLog property is restored to an empty vector. Use the propinfo function to determine if a property is read only.
Values for the BufferingConfig property when the BufferingMode property is set to Auto, and the MaxSamplesQueued property might not be restored to the same value because both these property values are based on available memory.
If you use the help command to display the M-file help for load, then you must supply the pathname shown below.
help daq/private/load
This example illustrates the behavior of load when the loaded device object has properties that differ from the workspace object.
ai = analoginput('winsound');
addchannel(ai,1:2);
save ai
ai.SampleRate = 10000;
load ai
Warning: Loaded object has updated property values.![]() | length | makenames | ![]() |
| © 1984-2008- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |