How can i write formatspecififcation regarding to amount of my line?

1 回表示 (過去 30 日間)
cemsi888
cemsi888 2015 年 3 月 5 日
コメント済み: Adam 2015 年 3 月 5 日
Now i am reading like txt files .first Comes Parameters than values. Every measurement file have different number of values that's why formatSpecification changes. Exmaple:
formatSpec4 = '%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%........%[^\n\r]';
(s* amount of-line) how can i define my format specification regarding to line number?
  7 件のコメント
cemsi888
cemsi888 2015 年 3 月 5 日
i can create desired amount of s and combined[^\n\r] but when i want read datas it gives me error.
Wertepar = textscan(fid1, formatSpec, lines-Gesamtzeile{1,1}, 'Delimiter', delimiter1, 'HeaderLines', Gesamtzeile{1,1}, 'ReturnOnError', false)´
program assume that formatspec ist just= %s
i used debug and wrote
a=fprintf('[^\\n\\r]',formatspec)
it gives me as a result 7.than i used num2str to convert number to string however it does not work too...
Adam
Adam 2015 年 3 月 5 日
If the formatspec is a string why are you calling num2str on it?

サインインしてコメントする。

回答 (0 件)

カテゴリ

Help Center および File ExchangeCharacters and Strings についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by