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

Community Tip - Learn all about PTC Community Badges. Engage with PTC and see how many you can earn! X

Multi-Level Parenthesis

MJ-StrEng
7-Bedrock

Multi-Level Parenthesis

How to write a simple expression with multi-level parenthesis in Math Cad Prime:

A={[(2+3)*5+(4+1)*8]*7+(2+4)}*6

This is very easy in Math Cad 15, but in Math Cad Prime when I open a parenthesis the program automatically inserts closing parenthesis not in the location I need; very frustrating.

9 REPLIES 9
ttokoro
20-Turquoise
(To:MJ-StrEng)

image.png

idahoan
11-Garnet
(To:ttokoro)

I have found that one method of adding parentheses is to highlight the portion of the equation or expression you want to separate with the parentheses, and then add a parentheses at the beginning or end:

 

1aidaho_2-1616643235728.png

1aidaho_1-1616643185583.png

Good luck!


@idahoan wrote:

I have found that one method of adding parentheses is to highlight the portion of the equation or expression you want to separate with the parentheses, and then add a parentheses at the beginning or end:

 


Not necessary! If you highlight the subexpression 2+3 and then type *, Prime will add the necessary pair of parentheses automatically.

Thank you all for helping me with my Multi-Level Parenthesis dilemma.

I do not care if my multi-level parenthesis are in format {[(abc)]} or (((abc))) either one is ok. What bothers me it that the program automatically inserts closing parenthesis and not in a place I want. I can work around it but it is very inconvenient.

Mathcad 15 do not have this problem, user controls closing parenthesis. I hope that Mathcad Prime developers can look into this and fix it.

Thanks again.

DJF
16-Pearl
16-Pearl
(To:MJ-StrEng)

This is not something that needs to be fixed.  It's maybe different than what you're used to, but it takes very little effort to figure out how to use it.  Just move your cursor to where you want and start typing.  The alternative is having mismatched parenthesis.  I've dealt with that in Excel, Matlab, etc for decades and I'm convinced it isn't better and is even more prone to error.  

  

that said it would be nice if Prime increased the size of outer parenthesis or changed their shape.  But that would take 1-2 hours of programming and I'm sure they can't afford the time. 

MJ-StrEng
7-Bedrock
(To:DJF)

Yes, you are right, I can and have to get used to the way parenthesis work in M-C Prime.

I used a wrong word  saying parenthesis insertions method should be "fixed," I should've said "modified."

I will adjust to the current method, no problem, but I still do not like the fact that the program and not the user controls the closing parenthesis.

To me changing size and shape of parenthesis is a secondary issue.

 

 

In my last answer I showed you how to input the expression without having to type any parenthesis at all just using the feature of highlighting partial expressions using the space key. Admittedly it requires some new thinking but it can be quite convenient (and its not new, you could do similarly in real Mathcad, too).

 

I understand that you would like to be able to type in the expression exactly as its written (with the exception that you can only use round brackets for structuring and no square or curved brackets). You want to type in the closing brackets yourself, right?

 

The good news is that you can do exactly that in Prime. Even though Prime adds the closing bracket automatically, you can type it yourself and the cursor will jump to the correct position.

Give it a try and type in exactly

( ( ( 2 + 3 ) * 5 + ( 4 + 1 ) * 8 ) * 7 + ( 2 + 4 ) ) * 6 =
and you get your expression - even with the unnecessary pair of parenthesis around (2+4) 

Pressing ) will position the cursor behind the closing bracket which is already there (otherwise you would have to press the right arrow key twice, which is annoying).

 

So Prime gives you full control but it won't allow you to type in an expression with unpaired or wrongly paired parenthesis. I wouldn't call that loosing control 😉

LucMeekes
23-Emerald III
(To:MJ-StrEng)

You should only use ( and ) for parentheses in equations.  If you type [ you are creating a vector.

If Prime detects it is necessary, it will automatically display some brackets in an expression as [  and ]. There is no user control on that.

 

Success!

Luc

You may type three opening parenthesis  to start with and then type in the numbers at the position needed.

 

But you can also type in the whole expression without having to type a single parenthesis if you take advantage of the space key to highlight subexpressions:

Type in as follows (sp means pressing the space key) :

 

2 + 3 sp sp * 5 + 4 + 1 sp sp * 8 sp sp sp * 7 + 2 + 4 sp sp sp * 6 =

 

In case you insist on the unnecessary pair of parentheses around (2+4) you may type it as follows:

 

2 + 3 sp sp * 5 + 4 + 1 sp sp * 8 sp sp sp * 7 + 2 + 4 sp sp ) sp sp * 6 =

 

 

Top Tags