Borrar filtros
Borrar filtros

What is the code to use for format spec in order to get matrix table where each column contain contain 4 data?

2 visualizaciones (últimos 30 días)
if true
Data = fopen('Track.txt', 'r');
formatspec = '';
Matrix = [4,inf];
DataInMatrix = fscanf(Data, formatspec, Matrix);
end

Respuesta aceptada

Star Strider
Star Strider el 5 de Mayo de 2015
This works:
fidi = fopen('Track.txt','r');
Data = textscan(fidi, '%s%f', 'Delimiter',':');
DataInMatrix = reshape(Data{2}, 4, []);

Más respuestas (0)

Categorías

Más información sobre Cell Arrays en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by