Importing HH:MM:SS from excel
Mostrar comentarios más antiguos
So I have an excel file with a column of time in format HH:MM:SS. I imported this column into Matlab by choosing ''Number'' in the Import Data tool in Matlab and called this imported column''Time''. Then I used the datestr(Time,'HH:MM:SS') command to convert my imported column Time into the HH:MM:SS format but the problem is it converts it to a 300x8 char. The conversion is correct in that I get everything in HH:MM:SS format but it isn't in the regular format (with the symbol of 4 small squares in the workspace, instead I have a square with'abc' inside it). Not sure what char is exactly but I want it in 300x1 format so that I can plot it because at the moment I can't.
Any ideas?
Thanks
Respuesta aceptada
Más respuestas (2)
Ahmet Cecen
el 10 de Mzo. de 2016
Editada: Ahmet Cecen
el 10 de Mzo. de 2016
0 votos
If you are using the import tool, use datetime, as in import as datetime initially. Then you will be able to access individual components like Data.Hour etc.
Jean-Paul McCarthy
el 25 de Abr. de 2018
0 votos
Copy the times to an .txt file then import them
Categorías
Más información sobre Data Import from MATLAB en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!