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 CenterFile Exchange에서 MATLAB에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by