logic question regarding two vectors
2 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
The two vectors, x=[0, -4, 7, 0, -1, 2], y=[1, -4, 8, 0, 1, 6] are given. Explain how matlab could reutrn...z = x and (not y)
Antworten (2)
David Hill
am 8 Sep. 2022
Really have no idea what you are asking.... just guessing
x=[0, -4, 7, 0, -1, 2];
y=[1, -4, 8, 0, 1, 6];
z=min(x,y)
8 Kommentare
Walter Roberson
am 8 Sep. 2022
The "or" operation for vectors is written as the | operator.
The "and" operation for vectors is written as the & operator.
The "not" operation for vectors is written as the ~ operator.
Note that for the purpose of MATLAB, a value is considered true if it is non-zero (except that it is an error to apply logical tests directly to NaN values.)
0 Kommentare
Siehe auch
Kategorien
Mehr zu Logical finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!