texscan multiple variables

Hello, I use texscan as something like
d = cell2mat(textscan(fid, '%f %f %f'));
My problem is that I have many variables of type f, say 30 of them, and I want somehow to input the number which indicates how many of them I need rather than typing %f %f %f %f %f etc. etc. every time. Any hint?
Chiara

 Akzeptierte Antwort

Matt Tearle
Matt Tearle am 21 Mär. 2011

0 Stimmen

fmt = repmat('%f',1,30);
d = cell2mat(textscan(fid,fmt));

Weitere Antworten (0)

Kategorien

Mehr zu MATLAB finden Sie in Hilfe-Center und File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by