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

2 次查看(过去 30 天)
if true
Data = fopen('Track.txt', 'r');
formatspec = '';
Matrix = [4,inf];
DataInMatrix = fscanf(Data, formatspec, Matrix);
end

采纳的回答

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

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Cell Arrays 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by