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

1 Ansicht (letzte 30 Tage)
cemsi888
cemsi888 am 5 Mär. 2015
Kommentiert: Adam am 5 Mär. 2015
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 Kommentare
cemsi888
cemsi888 am 5 Mär. 2015
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 am 5 Mär. 2015
If the formatspec is a string why are you calling num2str on it?

Melden Sie sich an, um zu kommentieren.

Antworten (0)

Kategorien

Mehr zu Characters and Strings finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by