Prev: Cell array
Next: xlsread in for structure
From: diana van dijk on 2 Apr 2010 16:49 Hi, I have a doubt concerning the use of interpn and the format of each parameter in the interpolation. I have: x1=linspace(.001,2,200) x2=linspace(.001,1,100) [X1 X2]=ndgrid(x1,x2) V=rand(size(X1)) alpha = linspace(.1,4,40); Y1= alpha*(state1-decision1)^beta %Y1 is a row vector Y2= gamma*state2 + decision2 %Y2 is a scalar VI = interpn( X1, X2, V, Y1, Y2) state1 and state2 are state variables over which I iterate, so these are scalars. decision1 and decision2 are the decision variables which are found through optimization. These are also scalars. X1 and X2 are ndgrid matrices and V is of the same size. Then, Y1 is a row vector of length alpha and Y2 is scalar value. The problem is that only decision1 gets optimal values. Decision2 always received zero as optimal value. So, I'm wondering if the interpolation is correct. My doubt lies with the format of Y1 and Y2. Should these be transformed to ndgrid matrices as well? If so, how can I do that when decision1 and decision2 are freely chosen, but bounded (lower and upper bounds) in the optimization code (fmincon)? I hope you can help me. Thanks!
|
Pages: 1 Prev: Cell array Next: xlsread in for structure |