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 Ansichten (letzte 30 Tage)
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

Antworten (1)

Marc Jakobi
Marc Jakobi am 10 Okt. 2016
Bearbeitet: Marc Jakobi am 10 Okt. 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));

Kategorien

Mehr zu Data Import and Analysis finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by