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

Rows_Gathered_Count.

lvl107
20-Turquoise

Rows_Gathered_Count.

Hi,
With intuition, I need help to write a function (in Mathcad 12) was briefly described as following:

Rows_Gathered_Count_1.PNG

In other words,

Rows_Gathered_Count_2.PNG

Thanks in advance.

-LL-

1 ACCEPTED SOLUTION

Accepted Solutions

Some kind of explanation added.

Regards. Alvaro.

View solution in original post

23 REPLIES 23
RichardJ
19-Tanzanite
(To:lvl107)

Column 1 of the output is the number. Column 3 is the number of occurrences. What's column 2? Sometimes it seems to be the index of the first occurrence, sometimes the index of the second.

lvl107
20-Turquoise
(To:RichardJ)

Sorry, Richard. I forgot to generalize my question.

Rows_Gathered_Count_3.PNG

-LL-

MikeArmstrong
5-Regular Member
(To:lvl107)

Loi,

There is no consistency in your answers.

I assume "L" is being called because it sits adjacent to the last time 0.968 occurs - If this is the case why had 0.981 got the letter "F"next to it. Shouldn't it be "O"

Mike

Similar to

http://communities.ptc.com/message/152543

Please check the attached.

Regards. Alvaro.

lvl107
20-Turquoise
(To:AlvaroDíaz)

It's a neat answer. Thanks a lot. Sorry, I forgot to generalize my question, above.

-LL-

Don't worry. Generalization added. Also use first or last letter in the answer. In your picture, letter for 0.981 is "F" or "O"? Notice that the csort at the end is optional.

Regards. Alvaro.

MikeArmstrong
5-Regular Member
(To:AlvaroDíaz)

Alvaro,

What Generalization? You shown two examples where the vaule 0.968 is returned with the letters "A" and "H", what does this mean?

Why not return "G"?

Mike

Generalization in the sense that first attach take the index of the data (a column vector) and the second attach take the second column to return not the position but the "associated" letter.

Why not G? Because first routine take the associate first associate letter where the value appear and the second routine take the last letter.

Regards. Alvaro.

MikeArmstrong
5-Regular Member
(To:AlvaroDíaz)

Why not G? Because first routine take the associate first associate letter where the value appear and the second routine take the last letter.

Regards. Alvaro.

Fair enough, but Loi should have stated what he wants the program to return - Maybe he wants all the corresponding letters returned???

Mike

MIke Armstrong wrote:

Fair enough, but Loi should have stated what he wants the program to return - Maybe he wants all the corresponding letters returned???

Mike

You're right. All letters added, and the routine code is more clear reading the 3 possible answers.

Cheers. Alvaro.

MikeArmstrong
5-Regular Member
(To:AlvaroDíaz)

Nice piece of work - Gold star coming your way.

Mike

Gold star? ¡Ignorance vade retro! Illuminati triunf!:-). Thanks Mike.

Alvaro.

Message was edited by: AlvaroDíaz

MikeArmstrong
5-Regular Member
(To:AlvaroDíaz)

Alvaro,

Would you be kind enough to explain how your program works?

I am pretty sure I know how you managed to get the array from the Match function, but not too sure how you managed to get the corresponding letters.

Cheers

Mike

Some kind of explanation added.

Regards. Alvaro.

lvl107
20-Turquoise
(To:AlvaroDíaz)

Thanks again for all your help.

-LL-

MikeArmstrong
5-Regular Member
(To:AlvaroDíaz)

Some kind of explanation added.

Regards. Alvaro.

Alvaro,

Cheers for taking the time to explain your method, much appreciated.

Mike

lvl107
20-Turquoise
(To:AlvaroDíaz)

Input.PNG

Output.PNG

Alvaro, your answer, the above, is very completely to my question. Thanks again for your time.
Regards,
-LL-

MikeArmstrong
5-Regular Member
(To:lvl107)

Loi Le wrote:

Input.PNG

Output.PNG

Alvaro, your answer, the above, is very completely to my question. Thanks again for your time.
Regards,
-LL-

Loi Le,

Alavro has done a fantastic job with the "RowsGatheredCount" function, defiantly one to file. You will notice that a lot off collabs will request similar requests to yours and the function can be changed easily.. The collection of the letters is the section I like .

Mike

Thanks for the words, but the merit's isn't mine, is for the collab concept. One of the keys for the functions is the Stuart's set function, based on the not presented function IsIn (check http://communities.ptc.com/message/91270#91270, but there are others oldies entries).

The distinction between sets and lists came from the old maple structure: sets are defined by {a,b,c} and lists with [a,b,c] In the old versions (like those that use mathcad 13) is imperative use the correct definition for functions like solve, which take as an argument only sets, but not lists, returning an error in this case. Mathematically this is correct, but introduces a number of issues, like not repeated values, distortions in the "natural" sort, continous convertions between types to avoid errors, etc.

Regards. Alvaro.

MikeArmstrong
5-Regular Member
(To:AlvaroDíaz)

AlvaroDíaz wrote:

Thanks for the words, but the merit's isn't mine, is for the collab concept. One of the keys for the functions is the Stuart's set function, based on the not presented function IsIn (check http://communities.ptc.com/message/91270#91270, but there are others oldies entries).

The distinction between sets and lists came from the old maple structure: sets are defined by {a,b,c} and lists with [a,b,c] In the old versions (like those that use mathcad 13) is imperative use the correct definition for functions like solve, which take as an argument only sets, but not lists, returning an error in this case. Mathematically this is correct, but introduces a number of issues, like not repeated values, distortions in the "natural" sort, continous convertions between types to avoid errors, etc.

Regards. Alvaro.

Alvaro,

Stuart also produced a similar function called "Setcount" which I posted. We don't see much of Stuart on here - shame.

Mike

lvl107
20-Turquoise
(To:AlvaroDíaz)

Alvaro, I was wondering that the "Lottery" title ( was mentioned by Mike before ) - Ought it to be refreshed here ? I also need help on that. Regards.-LL-

Lottery_Title_Refresh.PNG

MikeArmstrong
5-Regular Member
(To:lvl107)

If you look back through old posts you will see various methods of checking lottery numbers posted by collabs, - Search mike and lotter. If not, why not create a new thread as its not entirely clear exactly what your after.

Mike

MikeArmstrong
5-Regular Member
(To:lvl107)

Alternative in the attached.

MIke

Top Tags