cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Matlab short-circuiting behavior into Mathcad

JB_9681141
Participant

Matlab short-circuiting behavior into Mathcad

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

 

 

 

 

 

 

7 REPLIES 7

Re: Matlab short-circuiting behavior into Mathcad

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

 

g0.jpg

 

Alan

Re: Matlab short-circuiting behavior into Mathcad

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

 

Luc

Re: Matlab short-circuiting behavior into Mathcad


@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

 

Re: Matlab short-circuiting behavior into Mathcad

Ah, (real) Mathcad does,

LucMeekes_2-1605426450633.png

but Prime:

LucMeekes_0-1605426412858.pngLucMeekes_1-1605426421062.png

I've been using Prime too much...

Luc

Re: Matlab short-circuiting behavior into Mathcad

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.

 

 

 

Re: Matlab short-circuiting behavior into Mathcad

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

Re: Matlab short-circuiting behavior into Mathcad

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

 

 

Announcements