Import Data Tool Code

7 visualizaciones (últimos 30 días)
Shany Erez
Shany Erez el 8 de Feb. de 2021
Editada: Cris LaPierre el 8 de Feb. de 2021
Hi,
I Have been using the Import Data Tool to import data from a txt file to an array.
I want to get this operation into a code i try to use the uiimport(FileName) But i got the following error:
Error using importdata (line 228)
Unable to load file.
Use readtable for more complex formats.
Error in uiimport/runImportdata (line 531)
importdata(fileAbsolutePath);
Error in uiimport/gatherFilePreviewData (line 473)
[datastruct, textDelimiter, headerLines]=
runImportdata(fileAbsolutePath, type);
Error in uiimport (line 297)
gatherFilePreviewData(fileAbsolutePath);
Caused by:
Index exceeds the number of array elements (1).
I would really appreciate your assistance,
Shany.

Respuesta aceptada

Cris LaPierre
Cris LaPierre el 8 de Feb. de 2021
Editada: Cris LaPierre el 8 de Feb. de 2021
Is fileAbsolutePath the name of your text file? If so, try the following.
uiimport('fileAbsolutePath.txt')
If you want the Import Tool to generate code for importing the file based on the current settings, use the expanded options under "Import Selection". This video from our Exporatory Data Analysis with MATLAB course shows you how.

Más respuestas (0)

Categorías

Más información sobre Large Files and Big Data 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!

Translated by