已回答
using fminsearch with matrices
yep sean is right: your objective function should return a scaler if you want to use fminsearch. anyway, this is how you would d...

12 years 前 | 0

| 已接受

已回答
Using several variables with fsolve
yes, walther is right (of course), you need to keep the syntax for fsolve: YOur objective is: Ft=0, so pass as objective just...

12 years 前 | 0

已回答
apply a function to vector
you can loop for the second equation you gave for fn (the one with ^2): fn=@(a)[a(1)^2;a(2)^2;1]; w=... for iw=...

12 years 前 | 0

已回答
Looping a program or multiple variables?
you should keep it in vectorized form, unless you are really new to matlab as looping is usually easier to follow/debug about...

12 years 前 | 0

已回答
Need help with newton's theorem (matlab)
i dont think there is a perfect solution for this... a numerical algorithm that tries to find a minimum will have to stop somew...

12 years 前 | 0

已回答
Solving for Steady States in an Economics Model
just remove the time indexes of the variables and solve all the equations

12 years 前 | 0

已回答
looping in Dataset Array
just replace () with {} and it should work: myarray{i,w}==... and i recommend not to use 'i' since it is sqrt(-1)

12 years 前 | 0

| 已接受

已回答
problem in calculation of the mean??
you should use the 'reshape' command: transform the 'a x b x c x d' array (with d=4) into an matrix of size 'E x d' and take the...

12 years 前 | 0

已回答
How to add the iteration count to the code
With a loop, you could it something like this: for ik=1:N; R(1,ik)=normrnd(10000,3000); for it=2:36 R(...

12 years 前 | 0

已回答
How to add the iteration count to the code
you could make a R into a row vector (this will be faster than looping over k) N=1000; %number of simulations R=norm...

12 years 前 | 0

| 已接受

已回答
Using while loop
actually this is very simple. if you do some calculations in your while looop, and assign a value to some variable, then this va...

12 years 前 | 0

已回答
removing inner for loop
first: dont use 'i' and 'j' because they are sqrt(-1) and the imaginary part of an imaginary number. dont use 'sum' either, beca...

12 years 前 | 0

已回答
Forecasting in Matlab
This depends on what you want... what is your input? what should your output be?? how sophisticated? This is more a 'forecast...

12 years 前 | 0

已回答
Solve constrained linear least-squares problem such that A*x<=b
i think you should put up the question in the newsgroup as well. hopefully some linear programming expert will respond... th...

12 years 前 | 0

| 已接受

已回答
Solve constrained linear least-squares problem such that A*x<=b
i think i understand your problem. you wrote earlier "So every result of C*x should be in the range of 2 numbers (bottom and top...

12 years 前 | 0

已回答
Solve constrained linear least-squares problem such that A*x<=b
yes lsqlin gives you the best fit within boundaries, but you are not fitting. you are looking for all possible solutions that sa...

12 years 前 | 0

已回答
Solve constrained linear least-squares problem such that A*x<=b
o my god, i also didnt read carefull enough. i assumed you wanted to use lsqlin what it is supposed to do: find the best fit for...

12 years 前 | 0

已回答
Solve constrained linear least-squares problem such that A*x<=b
hmmm, it doesnt get me 'enters' so format is screwed: A=[-C, 0; C, 0; 0, -C; 0, C];

12 years 前 | 0

已回答
Solve constrained linear least-squares problem such that A*x<=b
you would have to rewrite all the equations as A*x<=b. i will show you as if you only had x1 and x2: 25<=C*x1<30 => -C*x1...

12 years 前 | 0

已回答
Solve constrained linear least-squares problem such that A*x<=b
i think you misunderstood the format if A*x<=b looks like: -x1 + 0*x2 <= b1 0*x1 + x2 <= b2 Then you have to insert...

12 years 前 | 0

已回答
Parallel Optimization with multistart and fmincon
just try?? this is likely to be very problem dependent...

12 years 前 | 0

已回答
Fminsearch high dimensional optimization (Excessive "Reflect" in procedure)
im facing a similar problem, and im looking into the global optimization toolbox. patternsearch or the genetic algorithm might b...

12 years 前 | 0

已回答
How to apply curve fitting with a model where y shows up on both sides of the equation.
i know how you could get your a, b and c using lsqnonlin (minimizing least squares), but im not sure if the statistical properpt...

12 years 前 | 0