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 CenterFile Exchange에서 Data Import and Analysis에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by