In R2012a, most methods for importing and exporting data to and from a model have been standardized to use MATLAB Timeseries.
For example, if you open the dialog of the To Workspace, you will see that timeseries is now the default save format:
Using MATLAB timeseries offers a lot of advantages as I described in a previous post on the dataset logging format.
Importing Bus Data
Let's say I want to import bus data, I create a structure of timeseries:
Then I specify the name of the variable or file, and the bus object in the From Workspace or From File dialog.
and we have a model importing buses!
Exporting Bus data
To export bus data, all you need to do do is connect the bus signal to a To Workspace or To File block and ensure the block is configured to use timeseries as save format (the default).
Once the data is in the MATLAB Workspace, you can use all timeseries methods to process your data.
For example, I can quickly detrend, filter and plot a random signal "b", contained inside bus "busOut":
Now its your turn
Are you going to include these new methods of loading and saving bus data in your workflow? Which is be best block pair for loading/saving buses? Let us know by leaving a comment here
要发表评论，请点击 此处 登录到您的 MathWorks 帐户或创建一个新帐户。