How can i read second column from a txt file in matlab
8 次查看(过去 30 天)
显示 更早的评论
here is the link of the file.
0 个评论
采纳的回答
Abdurrehman
2017-3-12
编辑:Abdurrehman
2017-3-12
[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 个评论
更多回答(0 个)
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!