Importdata imports nothing at all

조회 수: 2 (최근 30일)
Ira
Ira 2017년 1월 25일
편집: Chirag Parekh 2017년 1월 27일
Hi all,
(Matlab 2016b v- 9.1.0.441655)
I have a code which was working just fine in the past. For some odd reason it stopped working. This is the culprit part of the code
filename = '/home/spawn/Dropbox/PEGASUS/OnlineGraph/cleanResults.txt';
delimiterIn = ';';
A = importdata(filename,delimiterIn);
This results in importing an empty array ([ ]).
Trying to open a non-existent file yields an
Unable to open file.
Error, which isn't the case here.
Thanks!
-- Ira
  댓글 수: 2
Adam
Adam 2017년 1월 25일
Without knowing what is in your text file it is impossible to say really.
the cyclist
the cyclist 2017년 1월 25일
Can you upload a small example of a text file that exhibits this behavior, so that we can try to replicate it?

댓글을 달려면 로그인하십시오.

답변 (1개)

Chirag Parekh
Chirag Parekh 2017년 1월 27일
편집: Chirag Parekh 2017년 1월 27일
Make sure that the file is in ASCII format. Try the example at https://www.mathworks.com/help/releases/R2016b/matlab/ref/importdata.html#btldf1f-1
If the example works, the problem might be with the file. If you are not able to figure out the issue, please upload the file so that others can help.

카테고리

Help CenterFile Exchange에서 String Parsing에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by