使用范围配置对象以编程方式访问范围参数。
修改标题、轴标签和轴限制
打开或关闭图例或网格
控制输入的数量
更改显示的数量和哪个显示是活动的
在本例中,变量myConfiguration
使用。存储获取的掩码对象get_param
.该示例还展示了如何更改Scope参数的值。
mdl =“myModel”;new_system (mdl);
add_block (“万博1manbetx仿真软件/水槽/范围”, (mdl' / myScope ']);add_block (“dspsnks4 /时间范围”, (mdl' / myTimeScope ']);
许多范围配置属性对应于范围块的参数。
(mdl myConfiguration = get_param (' / myScope '],“ScopeConfiguration”)
myConfiguration =范围配置属性:名称:“myScope”位置:(680 390 560 420)可见:0 OpenAtSimulationStart: 0 DisplayFullPath: 0 PreserveColorsForCopyToClipboard: 0 NumInputPorts: ' 1 ' LayoutDimensions: [1] SampleTime: ' 1 ' FrameBasedProcessing: 0 MaximizeAxes:‘Off’MinimizeControls: 0 AxesScaling:'Manual' AxesScalingNumUpdates: '10' TimeSpan: 'Auto' TimeSpanOverrunAction: 'Wrap' TimeUnits: 'none' TimeDisplayOffset: '0' TimeAxisLabels: 'Bottom' ShowTimeAxisLabel: 0 ActiveDisplay: 1 Title:' % < SignalLabel >”
ShowLegend: 0 ShowGrid: 1 plotasmagnitphase: 0 YLimits: [-10 10] YLabel: " DataLogging: 0 DataLoggingVariableName: 'ScopeData' datalogginglimitdatpoints: 0 DataLoggingMaxPoints: '5000' DataLoggingDecimateData: 0 DataLoggingDecimateData: '2' DataLoggingSaveFormat: 'Dataset'
myConfiguration。DataLoggingMaxPoints =“10000”;
find_system (mdl“LookUnderMasks”,“上”,“IncludeCommented”,“上”,...“AllBlocks”,“上”,“BlockType”,“范围”)
ans = 'myModel/myScope' 'myModel/myTimeScope'
find_system (mdl“LookUnderMasks”,“上”,“IncludeCommented”,“上”,...“AllBlocks”,“上”,“BlockType”,“范围”,“DefaultConfigurationName”,...“万博1manbetxSimulink.scopes.TimeScopeBlockCfg”)
ans = ' myModel / myScope '
find_system (mdl“LookUnderMasks”,“上”,“IncludeCommented”,“上”,...“AllBlocks”,“上”,“BlockType”,“范围”,“DefaultConfigurationName”,...“spbscopes。TimeScopeBlockCfg”)
ans = ' myModel / myTimeScope '