Community Tip - Your Friends List is a way to easily have access to the community members that you interact with the most! X
Hi,
With intuition, I need help to write a function (in Mathcad 12) was briefly described as following:
In other words,
Thanks in advance.
-LL-
Solved! Go to Solution.
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.
Sorry, Richard. I forgot to generalize my question.
-LL-
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
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.
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.
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.
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
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
Thanks again for all your help.
-LL-
Some kind of explanation added.
Regards. Alvaro.
Alvaro,
Cheers for taking the time to explain your method, much appreciated.
Mike
Alvaro, your answer, the above, is very completely to my question. Thanks again for your time.
Regards,
-LL-
Loi Le wrote:
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.
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
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-
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