Skip to main content
1-Visitor
November 12, 2020
Question

Matlab short-circuiting behavior into Mathcad

  • November 12, 2020
  • 3 replies
  • 3157 views

Hi, i need this operator in mathcad (ll)

 

ll  Represents a logical OR operation that employs short-circuiting behavior. That is, expr2 is not evaluated if expr1 is logical 1 (true). Each expression must evaluate to a scalar logical result.

 

 
 

cf2e3bba-1001-4d5f-bd6a-d0290a1f14f3.jfif

 

 

 

 

 

 

3 replies

19-Tanzanite
November 12, 2020

Look at the Boolean toolbar.  The v symbol does what you want.

 

g0.jpg

 

Alan

23-Emerald IV
November 12, 2020

It does the OR, but it doesn't 'short-circuit', does it?

 

Luc

25-Diamond I
November 14, 2020

@LucMeekes wrote:

It does the OR, but it doesn't 'short-circuit', does it?

 

Luc


Mathcads OR does short circuit eval, otherwise doIt(0) would throw an error in the following example

Werner_E_0-1605387453319.png

 

23-Emerald IV
November 12, 2020

I have found no reliable way to do that in Mathcad.

Do you really need it to short-circuit?

If your first expression is 'per',  then the second expression 'per<0' can also be calculated...

 

Luc

23-Emerald I
November 12, 2020

Mathcad (or at least as I use it) doesn't have functions that return logical true/false.  How about

Fred_Kohlhepp_0-1605204593561.png

playing games:

Fred_Kohlhepp_0-1605264463989.png