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

 채택된 답변

Matt Tearle
Matt Tearle 2011년 3월 21일

0 개 추천

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

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Motor Control Blockset에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by