필터 지우기
필터 지우기

Info

이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.

What does diff(one inequality) do?

조회 수: 1 (최근 30일)
Yumeng Yin
Yumeng Yin 2021년 8월 24일
마감: Yumeng Yin 2021년 8월 24일
Hi, everyone, I saw a line of code: A=diff(B>=C), I am not sure what it does. Does it mean that, if B>=C, then do the differentiation between B and C? Hope someone with experience can help me answer this question. Thanks a lot.
  댓글 수: 2
Stephen23
Stephen23 2021년 8월 24일
Lets try it:
B = rand(1,11);
C = rand(1,11);
V = B>=C
V = 1×11 logical array
0 1 1 0 1 1 1 1 0 0 0
A = diff(V)
A = 1×10
1 0 -1 1 0 0 0 -1 0 0
So far everything behaves just as the GE and DIFF documentation explain.
Yumeng Yin
Yumeng Yin 2021년 8월 24일
Thanks a lot, Stephen, get it.

답변 (0개)

이 질문은 마감되었습니다.

태그

제품


릴리스

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by