how to read .data format data using matlab code??

5 visualizaciones (últimos 30 días)
Gayathri varu
Gayathri varu el 3 de Mayo de 2016
Comentada: Jan el 6 de Mayo de 2016
for example the file contains 4,43,1,1,?,1 this type format.i attached data file.please help how to read the data file

Respuestas (1)

Jan
Jan el 3 de Mayo de 2016
Editada: Jan el 6 de Mayo de 2016
Str = fileread(FileName);
Str = strrep(Str, '?', 'NaN'); % EDITED, "Str, " inserted
Str = strrep(Str, char(10), ',');
Value = sscanf(Str, '%f,');
Value = reshape(Value, 5, []).';
  2 comentarios
Gayathri varu
Gayathri varu el 4 de Mayo de 2016
sir,i try this the error occured.the error type is not enough input argument.
Jan
Jan el 6 de Mayo de 2016
Yes, there have been some typos. They are fixed now.

Iniciar sesión para comentar.

Categorías

Más información sobre Resizing and Reshaping Matrices 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