Is there a way to extract the numeric data from these chars?
Ältere Kommentare anzeigen
Hi folks,
I have a cell of times (attached), which I need to read as numbers. Is there any way to do this?
Using num2str() doesn't work!
Thanks!
Akzeptierte Antwort
Weitere Antworten (1)
The data inside of Time variable are in time format like mm:ss. You can use datetime to extract them.
new_T = datetime(Time(1:end),'InputFormat','mm:ss','Format','mm:ss')
timeDuration = new_T-new_T(1);
timeDuration_inSeconds = seconds(timeDuration)
timeDuration_inMintues = minutes(timeDuration)
I hope, it works for you.
Note: num2str() will convert number to string. The output will not be number.
Kategorien
Mehr zu Characters and Strings finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!