Filter löschen
Filter löschen

Info

Diese Frage ist geschlossen. Öffnen Sie sie erneut, um sie zu bearbeiten oder zu beantworten.

What does diff(one inequality) do?

1 Ansicht (letzte 30 Tage)
Yumeng Yin
Yumeng Yin am 24 Aug. 2021
Geschlossen: Yumeng Yin am 24 Aug. 2021
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 Kommentare
Stephen23
Stephen23 am 24 Aug. 2021
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 am 24 Aug. 2021
Thanks a lot, Stephen, get it.

Antworten (0)

Diese Frage ist geschlossen.

Tags

Produkte


Version

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by