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

Community Tip - New to the community? Learn how to post a question and get help from PTC and industry experts! X

Matlab short-circuiting behavior into Mathcad

JB_9681141
4-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

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

 

g0.jpg

 

Alan

LucMeekes
23-Emerald III
(To:AlanStevens)

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

 

Luc

Werner_E
25-Diamond I
(To:LucMeekes)


@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

 

LucMeekes
23-Emerald III
(To:Werner_E)

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

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.

 

 

 

LucMeekes
23-Emerald III
(To:JB_9681141)

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

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

Top Tags