How can i read second column from a txt file in matlab
6 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
arooba mazhar
am 12 Mär. 2017
Bearbeitet: Walter Roberson
am 12 Mär. 2017
here is the link of the file.
0 Kommentare
Akzeptierte Antwort
Abdurrehman
am 12 Mär. 2017
Bearbeitet: Abdurrehman
am 12 Mär. 2017
[Filename,FilePath]=uigetfile('\\Address\*.txt','Load File');
FileName=fullfile(FilePath,Filename);
NoofCol=7;% Total no of col. in ur file
Format=repmat('%s',1,NoofCol);
fid=fopen(FileName,'rt');
Header=fgetl(fid);% to delete first line (You can use this line as title for data plotting)
data_cell=textscan(fid,Format,'HeaderLines',1,'CollectOutput',1);
fclose(fid);
data=data_cell{1};
SecCol=str2double(data(:,2));
Hope the above will help you
3 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Whos 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!