How do I specify the datatype for readcell?
23 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Isaac Gruver
el 11 de Mayo de 2022
Respondida: dpb
el 11 de Mayo de 2022
I have a large text file filled with part numbers that I want to read into MatLab. When using the command, I get a cell array, which makes sense.
Unfortunately, some of the part numbers follow a XX-XX-XXXX` format, and MatLab reads those ones in as datatime values rather than character arrays, so I have a cell array filled with character arrays and a few datetimes. Is there a way to specify that all of the cells should be filled with character arrays?
0 comentarios
Respuesta aceptada
dpb
el 11 de Mayo de 2022
readcell will allow the use of an import options object whch would let you set the variable types. However, I'd strongly encourage the use of readtable instead; the table is far more convenient to use than having to dereference all cell arrays.
0 comentarios
Más respuestas (0)
Ver también
Categorías
Más información sobre Other Formats en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!