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 Center および File ExchangeLarge 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