What is wrong with this statement in an 'if' block?(adsbygoogle = window.adsbygoogle || []).push({});

if ((scalar1 == 0) || (scalar2 == 0) || (scalar3) == 0 || (scalar4 == 0))

I basically want to say: if any of the four scalars are individually equal to zero, then execute the subsequent statements.

I receive the following error in the command line:

Operands to the || and && operators must be convertible to logical scalar values.

Any suggestions?

**Physics Forums - The Fusion of Science and Community**

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!

# MATLAB Syntax

Loading...

Similar Threads - MATLAB Syntax | Date |
---|---|

Matlab Coding angular spectrum of waves in a fluid | Today at 7:30 AM |

How to program this in Matlab | Feb 28, 2018 |

Matlab Matlab syntax for 2-d fourier transform | Mar 21, 2016 |

MATLAB and LaTeX syntax | Sep 9, 2015 |

Matlab Numerical Integration - Syntax/Style Query | Dec 4, 2009 |

**Physics Forums - The Fusion of Science and Community**