Saving and loading AOs


Having made all these nice AOs, you will be keen to save them to disk. You'll be delighted to hear that this is easy.

To file formats are supported by LTPDA: the MATLAB binary MAT format, and an XML file format. The choice is made by the file extension.

  save(a1, 'foo.xml');
  save(a1, 'foo.mat');  

To load the files again, you use the AO constructor:

  a1 = ao('foo.xml');
  a2 = ao('foo.mat');

That's all there is to it.

To load files on the workbench, you use the relevant constructor block. For example, to load an AO XML file from disk, use the ao constructor with the parameter set "From XML File" (or "From MAT File" to load from a MAT file). This parameter set has one default parameter: FILENAME. If you double click the cell corresponding to the parameter value you will be presented with a 'load file' dialog from which you can choose the file to load.

To save files from within the workbench, use the save block. The parameter list and key is the same. The only difference will be you will be presented with a 'save file' dialog box when editing the parameter value.

The following pipeline shows the load and save in action:

Load/Save example



©LTP Team