texscan multiple variables

12 次查看(过去 30 天)
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 CenterFile Exchange 中查找有关 MATLAB 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by