www.gusucode.com > ecoder 案例源码程序 matlab代码 > ecoder/DataObjectWizardDemoExample.m
%% Create Data Objects Using Data Object Wizard % Many organizations need a fully specified set of data that is model-independent. The above model shows how the Data Object Wizard % can be used to automate the creation of data from a model. The Data Object Wizard analyzes a model and detects the signals, % parameters, states, and data stores that support Simulink data objects. Once the analysis is complete, a list of permissible Simulink data % objects is presented. You then select the objects of interest and the Data Object Wizard creates the corresponding Simulink data objects. %% Open Example Model % Open the example model |rtwdemo_dow|. % Copyright 2015 The MathWorks, Inc. open_system('rtwdemo_dow') %% Instructions % # Double-click the yellow Data Object Wizard button in the upper right of the diagram. % # Click the Find button to get a list of all signals and parameters that support Simulink Data Objects. % # Click the Check All button to select all objects. % # Click the Create button to create the corresponding Simulink data objects. % # Double-click the yellow Inspect Base Workspace button in the upper right to inspect the data objects. % # Change the storage class of the data objects to |ExportedGlobal| (batch edit from the spreadsheet view). % # Generate and inspect the code using the blue buttons in the upper right of the diagram. %% Notes % * Signals |H| and |K| are not presented in the Data Object Wizard because the inputs to the Merge block do not support Simulink data objects. % Only the output of a Merge block supports data objects. % * Goto and From blocks are supported, as shown by signal |B|. % * If a MATLAB variable already exists in the base workspace, the Data Object Wizard transfers its value to the |Value| property of the corresponding % Simulink parameter object.