I create with Table an array containing the function value of some function and the n1and n2arguments. Afterwards i want to look for the minimum function value within this array and find the corresponding arguments. And since i need that information for about 30 different functions that differ only slightly (in one parameter) from eachother, i want to create a code, that creates a list of functions and thus a list of minima and corresponding coordinates.
I've written a code for that, but it's unbelievable slow. Maybe you guys know faster and more elegant ways to solve that problem. Sin[n1]Sin[n2]is of course only an examplary function, my actual function has only one global minimum.
There is a condition to the code. I can't use FindMinimum or something similar on my function (don't want to get into that here), it needs to be a list of data points and one looks for a minimum value inside that list.
functiontable =
Table[{n1, n2, Sin[n1]Sin[n2]}, {i, 1, 5}];
temptabletable =
Table[Table[functiontable[[i]], {n1, 0, 5, 1}, {n2, 0, 5, 1}], {i,
1, 5}];
temppositiontable =
ux = Table[
Position[temptabletable[[i]], Min[temptabletable[[i]]]], {i, 1,
5}];
temppositiontablen1 =
Table[Take[Flatten[temppositiontable[[i]]], 1], {i, 1, 5}];
temppositiontablen2 =
Table[Take[Flatten[temppositiontable[[i]]], {2, 2}], {i, 1, 5}];
selectmatrixentrytable =
Table[{temppositiontablen1[[i]], temppositiontablen2[[i]]}, {i, 1,
5}];
minimumkoordinatentable =
Table[Flatten[{Take[Flatten[selectmatrixentrytable[[i]]], 1],
Take[Flatten[selectmatrixentrytable[[i]]], {2, 2}]}], {i, 1, 5}]
Min /@ temptabletable