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

 採用された回答

per isakson
per isakson 2014 年 3 月 21 日
編集済み: per isakson 2014 年 3 月 21 日

2 投票

"^" 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 件のコメント

Aga
Aga 2014 年 3 月 21 日
thanks a lot!, now it is clearer.And I thought just '~' stands for negation.
per isakson
per isakson 2014 年 3 月 21 日
"~" 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 2014 年 3 月 24 日
thanks!, I changed to 'not' .

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

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeInstrument Control Toolbox についてさらに検索

タグ

質問済み:

Aga
2014 年 3 月 21 日

コメント済み:

Aga
2014 年 3 月 24 日

Community Treasure Hunt

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

Start Hunting!

Translated by