How to read Value from .txt

1 view (last 30 days)
Here i am attaching screenshot of my file which is in .txt format, i have to read the three values (Marked in the screenshot) from the file. Could you please help me in this ??
  6 Comments
Arun Kumar Singh
Arun Kumar Singh on 15 Jun 2020
could you please write the proper code because i am new for matlab .

Sign in to comment.

Accepted Answer

Walter Roberson
Walter Roberson on 15 Jun 2020
filename = 'File.txt';
fid = fopen(filename, 'rt');
GAL = cell2mat(textscan(fid, '%*s%f%f%f', 1, 'headerlines', 2, 'collectoutput', true));
fclose(fid);
  1 Comment
Arun Kumar Singh
Arun Kumar Singh on 15 Jun 2020
Thank you sir, it worked ...

Sign in to comment.

More Answers (0)

Community Treasure Hunt

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

Start Hunting!

Translated by