texscan multiple variables

14 ビュー (過去 30 日間)
Chiara Modenese
Chiara Modenese 2011 年 3 月 21 日
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

採用された回答

Matt Tearle
Matt Tearle 2011 年 3 月 21 日
fmt = repmat('%f',1,30);
d = cell2mat(textscan(fid,fmt));

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeMATLAB についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by