How do import data?

6 visualizaciones (últimos 30 días)
Maria De Silva
Maria De Silva el 16 de Abr. de 2016
Respondida: Azzi Abdelmalek el 16 de Abr. de 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

Respuesta aceptada

Azzi Abdelmalek
Azzi Abdelmalek el 16 de Abr. de 2016
[a,~,~,~]=textread('file.txt')

Más respuestas (0)

Categorías

Más información sobre Data Import and Analysis en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by