Why does the stateflow function 'hasChanged(PS)' not work when PS is a vector?

2 ビュー (過去 30 日間)
Coder Error: PS contains a matrix or a structure type and cannot be used with change detection.? WHen PS is a scalar value, it works fine.

採用された回答

Gillian Rosen
Gillian Rosen 2017 年 4 月 10 日
Hi Nandish,
I understand that when you use the 'hasChanged' function in your Stateflow chart, you encounter an error that indicates that your input PS is a matrix or structure and therefore cannot be used with change detection. 
If you are using MATLAB as your action language, you unfortunately can only use a scalar value as input to hasChanged. If you would like to use vector or matrix inputs with hasChanged, please use C as your action language instead. See the note in the "hasChangedTo" section of the change detection documentation for more information: 
  1 件のコメント
Nandish Calchand
Nandish Calchand 2017 年 4 月 11 日
Hello, Thank you very much. Indeed the action language was the problem. But in the documentation of hasChanged(u), it does say that u can be a vector. Anyways thanks a lot. Nandish

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeComplex Logic についてさらに検索

タグ

製品

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by