What does '& ...' mean in Matlab?

조회 수: 9 (최근 30일)
JFz
JFz 2015년 7월 9일
댓글: Stephen23 2015년 7월 10일
I am new here and I don't know this expression: '& ...'. Can anyone explain?
I googled it but could not find an answer. Thanks.
Jennifer

채택된 답변

Azzi Abdelmalek
Azzi Abdelmalek 2015년 7월 9일
편집: James Tursa 2015년 7월 9일
&... is not an expression. & can be used as logical "and" operator
Example
a=10
b=20
a==10 & b==2
is equivalent to
and(a==10,b==2)
$ can be used otherwise in different situations
  댓글 수: 1
Stephen23
Stephen23 2015년 7월 10일
Image Analyst gives the correct answer below.

댓글을 달려면 로그인하십시오.

추가 답변 (1개)

Image Analyst
Image Analyst 2015년 7월 9일
You didn't give the whole line but my guess is that someone is doing a logical operation and is using ... to continue the operation on the next line. For example instead of doing
results = thisVariable & thatVariable;
they're putting it on 2 lines like this:
results = thisVariable & ...
thatVariable;
That's just a guess, Jennifer, as to what it could be. I can't know for sure because you forgot to include the line(s) of code.
  댓글 수: 2
JFz
JFz 2015년 7월 10일
Thank you!. Your answer is the right answer too. How can I mark it as the accepted answer?
Image Analyst
Image Analyst 2015년 7월 10일
Jennifer, once an answer has been accepted, there is no way to unaccept it. However, you can still "Vote" for Answers to give the person credit (reputation points) for giving a correct answer. Thanks!

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Particle & Nuclear Physics에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by