フィルターのクリア

How can i read second column from a txt file in matlab

7 ビュー (過去 30 日間)
arooba mazhar
arooba mazhar 2017 年 3 月 12 日
編集済み: Walter Roberson 2017 年 3 月 12 日

採用された回答

Abdurrehman
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 件のコメント
arooba mazhar
arooba mazhar 2017 年 3 月 12 日
Thanks alot it worked :)
Abdurrehman
Abdurrehman 2017 年 3 月 12 日
It was my very first answer :-)

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeGet Started with MATLAB についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by