07-19-2016 10:09 AM - edited 07-19-2016 10:11 AM
@ziedhosni wrote:I am trying to calculate f(x1,x2...,xn) of the Ackley function that can be of any dimensions.
http://www.sfu.ca/~ssurjano/ackley.html
I am trying to calculte xi for a grid of 10 or customisable for each dimension.
You are overthinking all this! Please take a step back....
Arrays of any dimension are just a long series of 1D elements in memory, with a header giving the size in each dimension. For utmost flexibility, just use a 1D array instead and do the math assigning elements to any particular point in N dimensions yourself. (Q&R comes in handy!). It is trivial math to convert between multidimensional indices to 1D indices (and back!). LabVIEW does for you when using higher dimension arrays, but you can equally well do yourself.
This is also more useful for fitting, for example, because the stock fit functions only accept 1D arrays. Simply fit the entire data pile as a flattened 1D array!
It is dificult to display data with more than 3 dimension anyway, so once you have that 1D array containing all elements. You can create costom tools to extract slices or planes of lower dimension for display.
Just try it! 😄
07-19-2016 10:11 AM
Altenbach, check out the lvproj I put together; it does just this 🙂
07-19-2016 10:12 AM
@ijustlovemath wrote:Altenbach, check out the lvproj I put together; it does just this 🙂
Ah OK. I haven't looked at it yet. Just woke up! 😄