How to get timer's UserData?

4 Ansichten (letzte 30 Tage)
JAI PRAKASH
JAI PRAKASH am 8 Sep. 2018
Kommentiert: JAI PRAKASH am 8 Sep. 2018
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

Akzeptierte Antwort

Walter Roberson
Walter Roberson am 8 Sep. 2018
R2014b or later
timer1.UserData.steer

Weitere Antworten (1)

Geoff Hayes
Geoff Hayes am 8 Sep. 2018
Jai - since the UserData is a struct, why not try
data = get(timer1, 'UserData');
steerData = data.steer;
  1 Kommentar
JAI PRAKASH
JAI PRAKASH am 8 Sep. 2018
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!!

Melden Sie sich an, um zu kommentieren.

Kategorien

Mehr zu Programming finden Sie in Help Center und File Exchange

Tags

Produkte


Version

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by