Beantwortet
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...

mehr als 12 Jahre vor | 0

| akzeptiert

Beantwortet
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...

mehr als 12 Jahre vor | 0

Beantwortet
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=...

mehr als 12 Jahre vor | 0

Beantwortet
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...

mehr als 12 Jahre vor | 0

Beantwortet
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...

mehr als 12 Jahre vor | 0

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

mehr als 12 Jahre vor | 0

Beantwortet
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)

mehr als 12 Jahre vor | 0

| akzeptiert

Beantwortet
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...

mehr als 12 Jahre vor | 0

Beantwortet
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(...

mehr als 12 Jahre vor | 0

Beantwortet
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...

mehr als 12 Jahre vor | 0

| akzeptiert

Beantwortet
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...

mehr als 12 Jahre vor | 0

Beantwortet
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...

mehr als 12 Jahre vor | 0

Beantwortet
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...

mehr als 12 Jahre vor | 0

Beantwortet
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...

mehr als 12 Jahre vor | 0

| akzeptiert

Beantwortet
I have a double variable equation with the values of x(a) and y(b), I am asked to find the maximum values(done) . Then I need to find which values of y are where the maximum happens. The problem is that the equation matriz(D) is 300 x 100.
[s, index]=max(D,[],1); your s contains the maximum value for each column, the index contains the row number. So b(index) giv...

mehr als 12 Jahre vor | 0

Beantwortet
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...

mehr als 12 Jahre vor | 0

Beantwortet
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...

mehr als 12 Jahre vor | 0

Beantwortet
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...

mehr als 12 Jahre vor | 0

Beantwortet
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];

mehr als 12 Jahre vor | 0

Beantwortet
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...

mehr als 12 Jahre vor | 0

Beantwortet
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...

mehr als 12 Jahre vor | 0

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

mehr als 12 Jahre vor | 0

Beantwortet
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...

mehr als 12 Jahre vor | 0

Beantwortet
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...

mehr als 12 Jahre vor | 0