このページの内容は最新ではありません。最新版の英語を参照するには、ここをクリックします。
clone
Stateflow チャートの操作点のコピー
説明
例
sf_car
モデルを開きます。openExample("sf_car")
このモデルの詳細については、Model a Car with Automatic Transmissionを参照してください。
最終の操作点を保存するようにモデルを設定します。[コンフィギュレーション パラメーター] ダイアログ ボックスを開き、[データのインポート/エクスポート] ペインで次を行います。
[最終状態] を選択し、操作点の名前を入力します。この例では、
xFinal
を使用します。[最終の操作点を保存] を選択します。
[OK] をクリックします。
このシミュレーション セグメントの終了時間を設定します。[シミュレーション] タブで、[終了時間] を
10
に設定します。シミュレーションを実行します。
shift_logic
チャートの操作点情報を含むStateflow.op.BlockOperatingPoint
オブジェクトにアクセスします。blockpath = "sf_car/shift_logic"; op = get(xFinal,blockpath);
gear_state
ステートの操作点情報を含むStateflow.op.OperatingPointContainer
オブジェクトにアクセスします。op.gear_state
ans = State: "gear_state" (handle) (active) Path: sf_car/shift_logic/gear_state Contains: + first "State (OR)" + fourth "State (OR)" + second "State (OR)" (active) + third "State (OR)"
操作点は、サブステート
second
がアクティブであることを示します。操作点のコピーを作成します。
newOp = clone(op);
gear_state
のアクティブなサブステートを変更することにより、新しい操作点を変更します。setActive(newOp.gear_state.first)
変更した操作点において、サブステート
first
がアクティブであることを確認します。newOp.gear_state
ans = State: "gear_state" (handle) (active) Path: sf_car/shift_logic/gear_state Contains: + first "State (OR)" (active) + fourth "State (OR)" + second "State (OR)" + third "State (OR)"
元の操作点において、サブステート
second
がアクティブであることを確認します。op.gear_state
ans = State: "gear_state" (handle) (active) Path: sf_car/shift_logic/gear_state Contains: + first "State (OR)" + fourth "State (OR)" + second "State (OR)" (active) + third "State (OR)"
入力引数
Stateflow チャートの操作点。Stateflow.op.BlockOperatingPoint
オブジェクトとして指定します。
出力引数
操作点のコピー。Stateflow.op.BlockOperatingPoint
オブジェクトとして返されます。
バージョン履歴
R2009b で導入
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Web サイトの選択
Web サイトを選択すると、翻訳されたコンテンツにアクセスし、地域のイベントやサービスを確認できます。現在の位置情報に基づき、次のサイトの選択を推奨します:
また、以下のリストから Web サイトを選択することもできます。
最適なサイトパフォーマンスの取得方法
中国のサイト (中国語または英語) を選択することで、最適なサイトパフォーマンスが得られます。その他の国の MathWorks のサイトは、お客様の地域からのアクセスが最適化されていません。
南北アメリカ
- América Latina (Español)
- Canada (English)
- United States (English)
ヨーロッパ
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)