Import Data Tool Code

조회 수: 7 (최근 30일)
Shany Erez
Shany Erez 2021년 2월 8일
편집: Cris LaPierre 2021년 2월 8일
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.

채택된 답변

Cris LaPierre
Cris LaPierre 2021년 2월 8일
편집: Cris LaPierre 2021년 2월 8일
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.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Large Files and Big Data에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by