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

Community Tip - Need to share some code when posting a question or reply? Make sure to use the "Insert code sample" menu option. Learn more! X

Putting into Parentheses.

lvl107
20-Turquoise

Putting into Parentheses.

Hi,
I have a question (is similar to the one is in the past.) need help (in Mathcad 12).

(A B).PNGa_b(A,B).PNG

Thanks in advance.
Regards, -LL-

1 ACCEPTED SOLUTION

Accepted Solutions
MikeArmstrong
5-Regular Member
(To:lvl107)

The output of the function in your worksheet (Wayne's suggestion), it seems to be "Marking to the match".

Sorry, I forgot to changed it round.

Have you got your answer now?

Mike

View solution in original post

37 REPLIES 37
MikeArmstrong
5-Regular Member
(To:lvl107)

So what do you want?

Just to indicate the non-matches?

Mike

lvl107
20-Turquoise
(To:MikeArmstrong)

Mike, I just need help writting a function with "Showing the Parentheses in the Output" like as "Lottery Tickets and Adding The Quotation Marks" was mentioned in couple of week ago. I was also wondering whether, is it possible ?. Showing the Parentheses to the non-match ( or XOR(A,B) ).

(A B).PNGMarkXOR( , ).PNG

Thanks again.

Regards, -LL-

MikeArmstrong
5-Regular Member
(To:lvl107)

It can be done.

I'll have a look tomorrow.

Mike

wayne
3-Visitor
(To:lvl107)

Loi Le

Refering to the Lottery ticket response by Richard,

you can repalce the function num2str(num) with format("( {0} )",num)

and you will get " (num) ", but I don't think you can get rid of the " " which designate a string.

lvl107
20-Turquoise
(To:wayne)

Wayne, following to your suggestion, its showing :

W

Thanks to your response.

Regards, -LL-

wayne
3-Visitor
(To:lvl107)

Loi Le,

Use the format() function from the Insert>function menu.

also the Lottery example was written for A which was a matrix of vectors, not a single vector.

I made some changes in the attached,

Wayne

lvl107
20-Turquoise
(To:wayne)

Wayne,

My Mathcad 12 cannot open your attached. Could you (or someone) please "Save as" the attached to MC 11 or MC 12. Wayne, I am really beginner in Mathcad Usage.
Thanks in advance for your time.
Regards, -LL-

MikeArmstrong
5-Regular Member
(To:lvl107)

I have slightly modified Wayne's function so both arrays are returned, see attached.

I'm sure it can be done a different way - will attempt after the F1 .

Mike

lvl107
20-Turquoise
(To:MikeArmstrong)

Mike,
It seems that my MC12 don't have a build-in format function, and its showing :

Not having build-in format function in MC12.PNG

Could you please show the image of the output of function (Wayne's).
Thanks for your time again.
Regards, -LL-

wayne
3-Visitor
(To:lvl107)

Saved as 12

RichardJ
19-Tanzanite
(To:lvl107)

Here are a couple of options that will work in MC12

lvl107
20-Turquoise
(To:RichardJ)

Richard, thanks for your help. Now I can see the output.

Thanks again.

Regards, -LL-

MikeArmstrong
5-Regular Member
(To:lvl107)

I'm not sure if the format function has been added in later versions of Mathcad.

Richard?

Mike

lvl107
20-Turquoise
(To:MikeArmstrong)

Mike,

The output of the function in your worksheet (Wayne's suggestion), it seems to be "Marking to the match".

WAYNE

Regards, -LL-

MikeArmstrong
5-Regular Member
(To:lvl107)

The output of the function in your worksheet (Wayne's suggestion), it seems to be "Marking to the match".

Sorry, I forgot to changed it round.

Have you got your answer now?

Mike

lvl107
20-Turquoise
(To:MikeArmstrong)

Mike,
I really don't know how to create a nested array : ( num ) is in this case.

Which button

Could you tell me about that : (there are the shortcut-key to create ...)

Oh, I almost forget : Now I have got my answer. (Thanks to all who replied...)

Correct Answer.PNG
Thanks in advance for your time.
Regards, -LL-

wayne
3-Visitor
(To:lvl107)

I think Richard just made a typo, he actually made a matirx with a single element.

num = 5 a:=( num ), then a = ( 5 )

for a nested array, do again: A:=( a ), the A= ({1,1})

lvl107
20-Turquoise
(To:wayne)

Wayne,

I appreciate your help. I follow your instruction above but it happens a = 5 and I still don't get that. Please tell me how to make a matrix with a single element as Richard did in Mathcad12, attach wiht mcd worksheet. (Sorry about my English as a Second Language is very little).
Thanks in advance.
Regards, -LL-

RichardJ
19-Tanzanite
(To:lvl107)

Please tell me how to make a matrix with a single element as Richard did in Mathcad12

There is no direct way to do it. You have to cheat a little. Type:

x[0:0

x=

The answer is a single element array. Copy and paste that to where you want it, and then change the contents.

lvl107
20-Turquoise
(To:RichardJ)

Richard, to my MC12, doing so sometime work, sometime don't, and I have to wait for several seconds and "Interrupt Processing". Anyway, I prefer this way.

Thanks again.

Regards, -LL-

lvl107
20-Turquoise
(To:RichardJ)

Richard, I have just understood your instruction and it always works well. (without "Interrupt Processing")

MatrixWithASingleElement.PNG

Thanks again.

Regards, -LL-

RichardJ
19-Tanzanite
(To:lvl107)

All I meant was this:

x_zero.gif

which certainly shouldn't cause any problems. Unless x is already defined, perhaps, in which cas use "xx" instead.

wayne
3-Visitor
(To:lvl107)

See the attached.
But also see Mathcad Help for matrices.

Wayne

RichardJ
19-Tanzanite
(To:wayne)

"For a single element matrix, just insert 1 column and 1 row".

That's not allowed in earlier versions.

MikeArmstrong
5-Regular Member
(To:wayne)

Nice explanation.

I think it would be a good idea for Mathcad to look at adding some kind of conditional formatting, similiar to Excel. Maybe not adding background colours, just being able to make certain results bold, underlined, Italic....ect.

Mike

I think it would be a good idea for Mathcad to look at adding some kind of conditional formatting, similiar to Excel. Maybe not adding background colours, just being able to make certain results bold, underlined, Italic....ect.

This has come up several times. For now, scripted components to the rescue. Again!

It would be nice if we didn't have to keep relying on scripted components to do some of these often desired tasks!

MikeArmstrong
5-Regular Member
(To:RichardJ)

I have seen that worksheet before. I was meaning something like below.

Example.jpg

Maybe it could have an array with mixed Math fonts???? There must be an easy way to program it.

Mike

There's no way to programmatically set the math font though (well there is, but it would require yet another function besed on a scripted component!).

MikeArmstrong
5-Regular Member
(To:RichardJ)

There's no way to programmatically set the math font though (well there is, but it would require yet another function besed on a scripted component!).

Would be a nice feature if implemented.

Could base it on the Excel feature. Maybe now have it as I have shown above, maybe a component.

Mike

Top Tags