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**

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

# Logical Operators in MATLAB

Loading...

Similar Threads for Logical Operators MATLAB |
---|

MATLAB MATLAB: forces acting on an object |

MATLAB Matlab histogram |

MATLAB Sovling Bernoulli's differential equation in matlab? |

MATLAB Matlab-like software |

MATLAB Matlab data into bins |

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