How to solve error with data file

조회 수: 5 (최근 30일)
Sohyeon Jeon
Sohyeon Jeon 2018년 10월 15일
편집: Sohyeon Jeon 2020년 7월 4일
Hello
I have a problem with the date files I've acquired from an audio-visual experiment.
audios = [0 1 2 1 2];
modes = [0 1 1 2 2];
DataFile = ls('a.mat','b.mat','c.mat','d.mat','sample.mat');
nRun = size(DataFile, 1);
I get error sign like this.
Error: AVtranslate_practice (line 11) S = load(deblank(DataFile(df,1:nRun)), 'gvals');
and that it cannot find the directory and files. Could you help me out on this problem?
Thanks!
  댓글 수: 1
KSSV
KSSV 2018년 10월 15일
Check whether the file name created is existing in the current working directory.

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

채택된 답변

madhan ravi
madhan ravi 2018년 10월 15일
편집: madhan ravi 2018년 10월 15일
  댓글 수: 2
Sohyeon Jeon
Sohyeon Jeon 2018년 10월 15일
편집: Sohyeon Jeon 2020년 7월 4일
Thank you very much
madhan ravi
madhan ravi 2018년 10월 15일
you‘re welcome you can also vote the answer :)

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

추가 답변 (1개)

Image Analyst
Image Analyst 2018년 10월 17일
What does ls() return? A cell array? A number.
Try this:
filename = deblank(DataFile(df, 1 : nRun))
fprintf('filename = %s\n', filename);
if exist(filename, 'file')
message = sprintf('%s exists!', filename);
uiwait(helpdlg(message));
else
message = sprintf('%s does not exist!', filename);
uiwait(warndlg(message));
end
What do you observe?

카테고리

Help CenterFile Exchange에서 File Operations에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by