Filter löschen
Filter löschen

What is Matlab equivalent of C++ ros::Duration() ?

1 Ansicht (letzte 30 Tage)
Rahul Bhadani
Rahul Bhadani am 27 Nov. 2015
Beantwortet: Dave Behera am 4 Dez. 2015
The way we call ros::Duration in C++, I need to call in Matlab. What its equivalent expression in MATLAB?
  1 Kommentar
Geoff Hayes
Geoff Hayes am 27 Nov. 2015
Rahul - are you referring to the code found here ros::Duration Class Reference? See date and time operations for (perhaps) equivalent functionality in MATLAB.

Melden Sie sich an, um zu kommentieren.

Akzeptierte Antwort

Dave Behera
Dave Behera am 4 Dez. 2015
As given in ros::Duration Class Reference, the duration object is created as:
ros::Duration five_seconds(5.0); //Duration of 5 seconds
A similar object can be created in MATLAB using 'duration' function:
>> d = duration(0,0,5)
d =
>> d2 = duration(0,0,4)
d2 =
>> d-d2
ans =
The duration function here is of form duration(hour, minute, second). Other ways to use duration can be found here:

Weitere Antworten (0)

Community Treasure Hunt

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

Start Hunting!

Translated by