How to solve error with data file

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 comentario

KSSV
KSSV el 15 de Oct. de 2018
Check whether the file name created is existing in the current working directory.

Iniciar sesión para comentar.

 Respuesta aceptada

madhan ravi
madhan ravi el 15 de Oct. de 2018
Editada: madhan ravi el 15 de Oct. de 2018

1 voto

2 comentarios

Sohyeon Jeon
Sohyeon Jeon el 15 de Oct. de 2018
Editada: Sohyeon Jeon el 4 de Jul. de 2020
Thank you very much
madhan ravi
madhan ravi el 15 de Oct. de 2018
you‘re welcome you can also vote the answer :)

Iniciar sesión para comentar.

Más respuestas (1)

Image Analyst
Image Analyst el 17 de Oct. de 2018
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?

Categorías

Más información sobre File Operations en Centro de ayuda y File Exchange.

Etiquetas

Preguntada:

el 15 de Oct. de 2018

Editada:

el 4 de Jul. de 2020

Community Treasure Hunt

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

Start Hunting!

Translated by