So I am trying to get a textfile onto matlab and define a matrix. I copied and pasted it onto the current folder in the name window next to the command window. In the command I put A=dlmread('file') but it keeps on giving me a cannot find file.

4 visualizaciones (últimos 30 días)
A=dlmread('file') Error using dlmread (line 62) The file 'channel_AVG_Gly_3.5ul_min_particlt_.5ul_min_01.txt' could not be opened because: No such file or directory

Respuestas (1)

Marc Jakobi
Marc Jakobi el 10 de Oct. de 2016
Editada: Marc Jakobi el 10 de Oct. de 2016
Try this:
pathname = 'path\to\file'; %path to the file
filename = 'file.txt'; %don't forget the file extension (.txt)
A = dlmread(fullfile(pathname,filename));
or
pathname = pwd;
filename = 'file.txt';
A = dlmread(fullfile(pathname,filename));

Categorías

Más información sobre Data Import and Analysis en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by