hi there, i have a sutpi question.. at the and of the string cpnversion specifiers of the matlab implemented import file function there is [^\n\r]. New line and carriage return is clear to me, but what the '^'means?..
formatSpec = '%s%s%s%s%f%f%f%s%s%s%[^\n\r]';
thanks in advance
aga

 Akzeptierte Antwort

per isakson
per isakson am 21 Mär. 2014
Bearbeitet: per isakson am 21 Mär. 2014

2 Stimmen

"^" is a negation. %[^\r\n] matches everything but line break, i.e. the rest of the line. Doc says
Exclude characters inside the brackets, reading until the first matching
character.

3 Kommentare

Aga
Aga am 21 Mär. 2014
thanks a lot!, now it is clearer.And I thought just '~' stands for negation.
per isakson
per isakson am 21 Mär. 2014
"~" is shorthand for the logical function not. (IMO: Use not, it makes the code more readable.) [^\r\n] is a loan from regular expression.
Aga
Aga am 24 Mär. 2014
thanks!, I changed to 'not' .

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Instrument Control Toolbox finden Sie in Hilfe-Center und File Exchange

Tags

Gefragt:

Aga
am 21 Mär. 2014

Kommentiert:

Aga
am 24 Mär. 2014

Community Treasure Hunt

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

Start Hunting!

Translated by