このページの翻訳は最新ではありません。ここをクリックして,英語の最新版を参照してください。
この例では,プログラミングスクリプトを使用してスコープを制御する方法を説明します。
プログラムによって范围のパラメーターにアクセスするために,范围の構成オブジェクトを使用します。
タイトル,軸ラベルおよび軸の範囲の変更
凡例またはグリッドの表示/非表示の切り替え
入力の数の制御
表示の数とアクティブな表示の変更
モデルを作成し、范围ブロックと时间范围ブロックを追加します。次に,get_param
を使用して范围構成オブジェクトmyConfiguration
を作成します。
mdl =“myModel”;new_system (mdl);add_block (“万博1manbetx仿真软件/水槽/范围”, (mdl' / myScope ']);add_block (“dspsnks4 /时间范围”, (mdl' / myTimeScope ']);(mdl myConfiguration = get_param (' / myScope '],“ScopeConfiguration”)
myConfiguration =范围配置属性:名称:“myScope”位置:(360 302 560 420)可见:0 OpenAtSimulationStart: 0 DisplayFullPath: 0 PreserveColorsForCopyToClipboard: 0 NumInputPorts: ' 1 ' LayoutDimensions: [1] SampleTime: ' 1 ' FrameBasedProcessing: 0 MaximizeAxes:‘Off’MinimizeControls: 0 AxesScaling:“手动”AxesScalingNumUpdates:‘10’时间间隔:“汽车”TimeSpanOverrunAction:“包装”TimeUnits:‘没有’TimeDisplayOffset: ' 0 ' TimeAxisLabels:“底部”ShowTimeAxisLabel: 0 ActiveDisplay: 1标题:' % < SignalLabel >“ShowLegend: 0 ShowGrid: 1 PlotAsMagnitudePhase: 0 YLimits: -10年[10]YLabel:“数据采集:0 DataLoggingVariableName:datalogginglimitdatpoints: 0 DataLoggingMaxPoints: '5000' DataLoggingDecimateData: 0 DataLoggingDecimation: '2' DataLoggingSaveFormat: 'Dataset'
プロパティを設定します。
myConfiguration。DataLoggingMaxPoints =“10000”;
范围ブロックおよび时间范围ブロックを検索します。
find_system (mdl“LookUnderMasks”,“上”,“IncludeCommented”,“上”,...“AllBlocks”,“上”,“BlockType”,“范围”)
ans =2 x1细胞{' myModel / myScope '} {' myModel / myTimeScope '}
万博1manbetx模型范围ブロックのみを検索します。
find_system (mdl“LookUnderMasks”,“上”,“IncludeCommented”,“上”,...“AllBlocks”,“上”,“BlockType”,“范围”,“DefaultConfigurationName”,...“万博1manbetxSimulink.scopes.TimeScopeBlockCfg”)
ans =1 x1单元阵列{' myModel / myScope '}
DSP时间范围ブロックのみを検索します。
find_system (mdl“LookUnderMasks”,“上”,“IncludeCommented”,“上”,...“AllBlocks”,“上”,“BlockType”,“范围”,“DefaultConfigurationName”,...“spbscopes。TimeScopeBlockCfg”)
ans =1 x1单元阵列{' myModel / myTimeScope '}
范围構成オブジェクトのプロパティの詳細については,TimeScopeConfiguration
を参照してください。