Get Help

Turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

- Community
- :
- PTC Mathcad
- :
- PTC Mathcad
- :
- Matlab short-circuiting behavior into Mathcad

Options

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

11-12-2020
11:37 AM

11-12-2020
11:37 AM

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.

7 REPLIES 7

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

11-12-2020
11:54 AM

11-12-2020
11:54 AM

Re: Matlab short-circuiting behavior into Mathcad

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

Alan

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

11-12-2020
12:06 PM

11-12-2020
12:06 PM

Re: Matlab short-circuiting behavior into Mathcad

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

Luc

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

11-14-2020
03:57 PM

11-14-2020
03:57 PM

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

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

11-15-2020
02:48 AM

11-15-2020
02:48 AM

Re: Matlab short-circuiting behavior into Mathcad

Ah, (real) Mathcad does,

but Prime:

I've been using Prime too much...

Luc

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

11-15-2020
11:15 AM

11-15-2020
11:15 AM

Re: Matlab short-circuiting behavior into Mathcad

`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.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

11-12-2020
12:05 PM

11-12-2020
12:05 PM

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

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

11-12-2020
01:10 PM

11-12-2020
01:10 PM

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

playing games: