I solved my last problem, however, I have another question with regards to logical operators in MATLAB.(adsbygoogle = window.adsbygoogle || []).push({});

Suppose I have four column arrays "one," "two," "three," and "four." Each array contains 500 scalar values. How can I say:

If any one 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?

**Physics Forums | Science Articles, Homework Help, Discussion**

Dismiss Notice

Join Physics Forums Today!

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

# Logical Operators in MATLAB

**Physics Forums | Science Articles, Homework Help, Discussion**