- #1
hoffmann
- 70
- 0
I solved my last problem, however, I have another question with regards to logical operators in MATLAB.
Suppose I have four column arrays "one," "two," "three," and "four." Each array contains 500 scalar values. How can I say:
If anyone of these scalar values are equal to zero then execute the following code.
Obviously, I can't just say:
if(one = 0 || two = 0 || three = 0 || four = 0)
random code
end
The || operator needs a scalar input so the above wouldn't work. How can I fix this?
Suppose I have four column arrays "one," "two," "three," and "four." Each array contains 500 scalar values. How can I say:
If anyone of these scalar values are equal to zero then execute the following code.
Obviously, I can't just say:
if(one = 0 || two = 0 || three = 0 || four = 0)
random code
end
The || operator needs a scalar input so the above wouldn't work. How can I fix this?