Prev: Why can't Mathematica tell when something is
Next: Mathematica function to calculate correlation
From: cool-RR on 9 Mar 2010 06:17 Hello, I want to run this: `NMinimize[Distances[x, seq, z], x]` But x should be a vector whose dimensions will only be known at run time. How can I do this? I know I could put vectors into NMinimize, but how to do it when the dimension isn't known until runtime? Thanks, Ram.
From: cool-RR on 10 Mar 2010 01:41 Thanks, it's working. Ram. On Tue, Mar 9, 2010 at 4:22 PM, dh <dh(a)metrohm.com> wrote: > Hi Ram, > you want to minimize a scalar function of a vector argument. > I hope you are aware of the pitfalls of local and global minimas. > Let us call this function fun. > We now create a vector with variables with the requeste length, that can be > used inside NMinimize. Here is an example: > > x0 = {1, 2}; > fun[x_] := Norm[x0 - x] > x = Table[Unique[x], {Length[x0]}]; > NMinimize[fun[x], x] > > > On 09.03.2010 12:17, cool-RR wrote: > >> Hello, >> >> I want to run this: `NMinimize[Distances[x, seq, z], x]` But x should >> be a vector whose dimensions will only be known at run time. How can I >> do this? I know I could put vectors into NMinimize, but how to do it >> when the dimension isn't known until runtime? >> >> Thanks, >> Ram. >> >> > > -- > > Daniel Huber > Metrohm Ltd. > Oberdorfstr. 68 > CH-9100 Herisau > Tel. +41 71 353 8585, Fax +41 71 353 8907 > E-Mail:<mailto:dh(a)metrohm.com> > Internet:<http://www.metrohm.com> > > -- Sincerely, Ram Rachum
From: dh on 10 Mar 2010 01:45 be used inside NMinimize. Here is an example: fun[x_] := Norm[x0 - x] On 09.03.2010 12:17, cool-RR wrote: > I want to run this: `NMinimize[Distances[x, seq, z], x]` But x should E-Mail:<mailto:dh(a)metrohm.com> Internet:<http://www.metrohm.com>
|
Pages: 1 Prev: Why can't Mathematica tell when something is Next: Mathematica function to calculate correlation |