How do import data?

7 ビュー (過去 30 日間)
Maria De Silva
Maria De Silva 2016 年 4 月 16 日
回答済み: Azzi Abdelmalek 2016 年 4 月 16 日
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

採用された回答

Azzi Abdelmalek
Azzi Abdelmalek 2016 年 4 月 16 日
[a,~,~,~]=textread('file.txt')

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeData Import and Analysis についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by