MATLAB: How do import data

importing data

For this part I have to get data from the first row. Which I know you use fgetl. But what if my data has 4 columns and 5 rows. And I want to get data from the first column. How do I do that?
if true
% filename='lab4_data.txt';
fid=fopen(filename,'r'); %opening read only
temperature=fgetl(fid);
temperature=str2num(temperature);
fclose(fid);code
end

Best Answer

[a,~,~,~]=textread('file.txt')