MATLAB: How to read Value from .txt

read string from .txtread value from txt

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 ??

Best Answer

filename = 'File.txt';
fid = fopen(filename, 'rt');
GAL = cell2mat(textscan(fid, '%*s%f%f%f', 1, 'headerlines', 2, 'collectoutput', true));
fclose(fid);