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 Exchange에서 Instrument 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