How to get timer's UserData?

9 ビュー (過去 30 日間)
JAI PRAKASH
JAI PRAKASH 2018 年 9 月 8 日
コメント済み: JAI PRAKASH 2018 年 9 月 8 日
I am fetching timer's UserData with the below command
data = get(timer1, 'UserData');
Problem is, it gives whole userdata. Suppose if only partial data is required.
for e.g. just steer data is required.
Is there something like this
data = get(timer1, 'UserData.data'); ??
Thank you

採用された回答

Walter Roberson
Walter Roberson 2018 年 9 月 8 日
R2014b or later
timer1.UserData.steer
  1 件のコメント
JAI PRAKASH
JAI PRAKASH 2018 年 9 月 8 日
Wow. thanks

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

その他の回答 (1 件)

Geoff Hayes
Geoff Hayes 2018 年 9 月 8 日
Jai - since the UserData is a struct, why not try
data = get(timer1, 'UserData');
steerData = data.steer;
  1 件のコメント
JAI PRAKASH
JAI PRAKASH 2018 年 9 月 8 日
Ya, i tried this, it works also.
But i doubt the efficiency of this method.
I mean if we can able to call just steer, I guess it would be more efficient!!

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

カテゴリ

Help Center および File ExchangeTime Series Events についてさらに検索

タグ

製品


リリース

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by