How do import data?

7 visualizzazioni (ultimi 30 giorni)
Maria De Silva
Maria De Silva il 16 Apr 2016
Risposto: Azzi Abdelmalek il 16 Apr 2016
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

Risposta accettata

Azzi Abdelmalek
Azzi Abdelmalek il 16 Apr 2016
[a,~,~,~]=textread('file.txt')

Più risposte (0)

Categorie

Scopri di più su Data Import and Analysis in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by