2,317 reputation
3615
bio website
location
age
visits member for 1 year, 11 months
seen Mar 28 at 12:38

Oct
11
answered How to know if a number is the square of a rational?
Oct
11
revised Function to select a row whose kth element is closest to a given number
added 1056 characters in body
Oct
11
comment Function to select a row whose kth element is closest to a given number
I just looked up memoization on wikipedia. It will take be a bit to appreciate and understand the differences between the two ways you described. To address your comment, I actually have a list of 20 different numbers each for about a 100 Matrices. So b , the comparison number, is itself a list and for each of those b's I want to find something in column k closest to it. Then I do this for a 100 Matrices, each with a unique b. This is for one set of overall parameters. So I might wind up doing 2000 such uses of the function, many many times.
Oct
11
comment Function to select a row whose kth element is closest to a given number
@Mr.Wizard thanks. The reason I wanted this as a function is because I will wind up using it on lots of different lists for lots of different columns. I'm guess the function form is better for that.
Oct
11
comment Function to select a row whose kth element is closest to a given number
@Rojo and Daniel .. I just noticed and fixed the typo in my question.
Oct
11
revised Function to select a row whose kth element is closest to a given number
deleted 955 characters in body
Oct
11
comment Function to select a row whose kth element is closest to a given number
@Rojo in this example, the first element but in my actual problem some kth element.
Oct
11
revised Function to select a row whose kth element is closest to a given number
added 671 characters in body
Oct
11
comment Function to select a row whose kth element is closest to a given number
oh.. the stuff after the _ has meaning... I thought that was just so the programmer can keep track of stuff. Let me try your function.. thanks a lot Mr. Wizard!
Oct
10
comment Function to select a row whose kth element is closest to a given number
Also, can you please make your code into a function. I would like to learn how to do that. Why does nff[num_numba, l_list] := Nearest[Map[Rule[#[[1]], #] &, l]][num][[1]] and nuff[b, list] produce garbage?
Oct
10
comment Function to select a row whose kth element is closest to a given number
Oh man! good MMA code is so slick! Thanks a lot Daniel! What was I doing wrong in my disT function though?
Oct
10
comment Function to select a row whose kth element is closest to a given number
@DanielLichtblau I only want to use the Distance function on columns which have real entries.
Oct
10
asked Function to select a row whose kth element is closest to a given number
Oct
10
comment Showing a forest with root of the trees on the top
@Mohsen Thank you for the accept! This is my first answer.. I feel so excited and useful. lol.
Oct
10
comment Showing a forest with root of the trees on the top
@Mohsen oh cool. I didn't know one could do that! Thx!
Oct
10
comment Showing a forest with root of the trees on the top
@Mohsen I edited the answer to address your concerns.
Oct
10
revised Showing a forest with root of the trees on the top
added 737 characters in body
Oct
10
awarded  Teacher
Oct
10
answered Showing a forest with root of the trees on the top
Oct
9
asked Export to Excel gives error for large lists