MATLAB: How to export data/transfer functions from system identification to Matlab workspace using script

controlssystem identification

I am working with system identification toolbox, and have found the method to call on my .sid file to load all data from the .sid, but am not able to find any information on exporting that data or the transfer functions in system identification to the Matlab workspace via commands in my script rather than having to manually re-enter them into my workspace via the GUI.

Best Answer

Suppose you have testit.sid then
S = load('testit.sid', '-mat');
Now S will be a field with several fields.
The field named Data will (probably) be a cell array of iddata, one entry for each square that is filled in in the "Import data" section.
The field named Models will be a cell array of various data types, one entry for each square that is filled in in the "Import models" section.
For example in my test, S.Models{2} is a 1 x 2 idtf . Its parts can be examined with, for example, S.Models{2}.Numerator and S.Models{2}.Denominator and S.Models{2}.Report is a struct with information about the transfer function estimation, and for example, S.Model{2}.Report.Parameters.Labels and S.Model{2}.Report.Parameters.ParVector
Related Question