Question

sum elements of matrix if...

Hi, lets say i have two matrices: A=rand(5,10); B=[ones(1,10);3*ones(1,10);ones(1,10);ones(1,10);3*ones(1,10)]; I...

presque 12 ans il y a | 2 réponses | 0

Réponse apportée

fixed-point iteration for root finding

a while loop might be a good idea: err_lim = 1e-6; x_new = %initial guess err = err_lim *2; %arbitrary to pass while ...

fixed-point iteration for root finding

a while loop might be a good idea: err_lim = 1e-6; x_new = %initial guess err = err_lim *2; %arbitrary to pass while ...

environ 12 ans il y a | 0

Réponse apportée

how to solve a system of equations with n equation and m unknown (m>n)?

i think fmincon (constrained optimization) will work best... if you try to minimize some error use as the objective: objective=e...

how to solve a system of equations with n equation and m unknown (m>n)?

i think fmincon (constrained optimization) will work best... if you try to minimize some error use as the objective: objective=e...

environ 12 ans il y a | 0

Réponse apportée

How to stop nonlinear fitting and obtain the results of fitting at that iteration

the display iter only displays something after an iteration is complete (after all function evaluations of that iteration are do...

How to stop nonlinear fitting and obtain the results of fitting at that iteration

the display iter only displays something after an iteration is complete (after all function evaluations of that iteration are do...

environ 12 ans il y a | 0

Réponse apportée

How to stop nonlinear fitting and obtain the results of fitting at that iteration

im no expert on this (sorry) but did you try the 'output' function thingy... i know for most optimizers there is such a thing. i...

How to stop nonlinear fitting and obtain the results of fitting at that iteration

im no expert on this (sorry) but did you try the 'output' function thingy... i know for most optimizers there is such a thing. i...

environ 12 ans il y a | 0

Réponse apportée

what is the optimal way to build a sparse matrix from row/col index, and value data?

did you check 'sparse'? i think this will do what you want: S = sparse(i,j,s) where i,j,s are your 3 column vectors... htt...

what is the optimal way to build a sparse matrix from row/col index, and value data?

did you check 'sparse'? i think this will do what you want: S = sparse(i,j,s) where i,j,s are your 3 column vectors... htt...

environ 12 ans il y a | 0

| A accepté

Réponse apportée

Optimization: Which algorithms I should choose when it's difficult to define an objective function?

...and if your problem is continuous, then the other optimizers are more usefull (fminsearch, fminunc, fsolve, fmincon,...). ...

Optimization: Which algorithms I should choose when it's difficult to define an objective function?

...and if your problem is continuous, then the other optimizers are more usefull (fminsearch, fminunc, fsolve, fmincon,...). ...

environ 12 ans il y a | 0

Réponse apportée

how can i remove this error in matlab?

ermm, what error? and what do you actually want the line to achieve? i mean, the code wants to assign a matrix with blanks to co...

how can i remove this error in matlab?

ermm, what error? and what do you actually want the line to achieve? i mean, the code wants to assign a matrix with blanks to co...

environ 12 ans il y a | 0

Question

Problem using 'deal' for objective and gradient in comb. with 'DerivativeCheck'

When using optimization tools I usually keep my objective function and gradient function as separate subfunctions and then use '...

environ 12 ans il y a | 1 réponse | 0

Réponse apportée

The problem in fminsearch function error

i dont know what you want this to do: x = sym(zeros(6,1)); for i=1:1:6 x(i) = sym(sprintf('x%d',i)); end or: ...

The problem in fminsearch function error

i dont know what you want this to do: x = sym(zeros(6,1)); for i=1:1:6 x(i) = sym(sprintf('x%d',i)); end or: ...

environ 12 ans il y a | 0

| A accepté

Question

Calculating stationary distribution of Markov chain

I am calculating the stationary distribution of a Markov chain. The transition matrix P is sparse (at most 4 entries in every co...

environ 12 ans il y a | 2 réponses | 1

Question

me not like new lay out of this section! (not a question)

i dislike the new lay out of this section, because now only 2 or 3 questions fit on my screen, ie. any overview is lacking and i...

environ 12 ans il y a | 2 réponses | 2

Réponse apportée

problem with dynamic optimization solution when increasing the scaling parameter value of the objective function

What is your utility function and how do you scale it? And is zero also your starting value for the controls? The only thing...

problem with dynamic optimization solution when increasing the scaling parameter value of the objective function

What is your utility function and how do you scale it? And is zero also your starting value for the controls? The only thing...

environ 12 ans il y a | 0

Réponse apportée

Question about fsolve

first you should try yourself to solve the equation when there is just 1 line (1 a and a_1). see what's happening... and then in...

Question about fsolve

first you should try yourself to solve the equation when there is just 1 line (1 a and a_1). see what's happening... and then in...

environ 12 ans il y a | 0

| A accepté

Réponse apportée

Vectorizing finding indexes

Hmmmmm, andrei and jamie: do your solutions only work when Y consists of integers??? In my example Y was just integers, but in f...

Vectorizing finding indexes

Hmmmmm, andrei and jamie: do your solutions only work when Y consists of integers??? In my example Y was just integers, but in f...

environ 12 ans il y a | 0

Question

Vectorizing finding indexes

hi, i have a vector X and a vector Y (both in ascending order). for every element in X i want the indexes of the values in Y be...

environ 12 ans il y a | 4 réponses | 0

Réponse apportée

using fminsearch on several data sets simultaneously

As an alternative you could make an optimization routine for K only. That way you would not need fminunc. It would look very ...

using fminsearch on several data sets simultaneously

As an alternative you could make an optimization routine for K only. That way you would not need fminunc. It would look very ...

environ 12 ans il y a | 1

| A accepté

Réponse apportée

using fminsearch on several data sets simultaneously

To answer the original post: if you have N data sets, you just have to combine the objective functions for the N data sets, so ...

using fminsearch on several data sets simultaneously

To answer the original post: if you have N data sets, you just have to combine the objective functions for the N data sets, so ...

environ 12 ans il y a | 0

Réponse apportée

Solve non-linear equation with 2 unknowns and lb/ub constraints

to get the min instead of max you have to put a minus in the objective (and yes this is annoying) but if you just try to maxi...

Solve non-linear equation with 2 unknowns and lb/ub constraints

to get the min instead of max you have to put a minus in the objective (and yes this is annoying) but if you just try to maxi...

plus de 12 ans il y a | 0

Réponse apportée

Question about fsolve

first of all you should delete the /M in the objective, because this only scales your problem in a bad way. another problem cou...

Question about fsolve

first of all you should delete the /M in the objective, because this only scales your problem in a bad way. another problem cou...

plus de 12 ans il y a | 0

Réponse apportée

fminsearch with boundary conditions on parameters

in the file exchange there is an fminsearch with boundaries (fminsearchbnd) i assume you dont have the optimization toolbox, ...

fminsearch with boundary conditions on parameters

in the file exchange there is an fminsearch with boundaries (fminsearchbnd) i assume you dont have the optimization toolbox, ...

plus de 12 ans il y a | 0

| A accepté

Réponse apportée

Non-negativity for unconstrained nonlinear multivariable function

if you want your inputs to be positive, just add them as a lower bound, see documention. For example if your x is a vector of th...

Non-negativity for unconstrained nonlinear multivariable function

if you want your inputs to be positive, just add them as a lower bound, see documention. For example if your x is a vector of th...

plus de 12 ans il y a | 0

Réponse apportée

a question on fsolve

the problem in the first case is that matlab assumes that every x will show up in every equation. In other words, it will try to...

a question on fsolve

the problem in the first case is that matlab assumes that every x will show up in every equation. In other words, it will try to...

plus de 12 ans il y a | 0

Réponse apportée

fmincon and constrains

if you want to minimize all the values in the vector, you can sum them and use that as your objective.... about the not equal...

fmincon and constrains

if you want to minimize all the values in the vector, you can sum them and use that as your objective.... about the not equal...

plus de 12 ans il y a | 0

Réponse apportée

fsolve with multidimensional array and x0

if you want to stick more to your orginal formulation: the problem is that your x0 has to be a vector, not an array, so you will...

fsolve with multidimensional array and x0

if you want to stick more to your orginal formulation: the problem is that your x0 has to be a vector, not an array, so you will...

plus de 12 ans il y a | 1

| A accepté

Réponse apportée

syntax of fsolve

you should write it as a function (in either anonymous function, function file or subfunction if your main program is also a fun...

syntax of fsolve

you should write it as a function (in either anonymous function, function file or subfunction if your main program is also a fun...

plus de 12 ans il y a | 0

Réponse apportée

How do I set my fmincon constraint parameters?

you can insert them as nonlinear constraints (as functions, see the documentation).

How do I set my fmincon constraint parameters?

you can insert them as nonlinear constraints (as functions, see the documentation).

plus de 12 ans il y a | 0

Réponse apportée

Equation solving problem

im sure we can help you very well with this what do you have so far? or which part is difficult for you? anyway, we have ...

Equation solving problem

im sure we can help you very well with this what do you have so far? or which part is difficult for you? anyway, we have ...

plus de 12 ans il y a | 0

| A accepté

Réponse apportée

need help with optimtool

although this does not matter much, you should add an 'end' how do you call obj.m with fmincon? and where did you store obj.m...

need help with optimtool

although this does not matter much, you should add an 'end' how do you call obj.m with fmincon? and where did you store obj.m...

plus de 12 ans il y a | 0

| A accepté

Réponse apportée

need help with optimtool

apparently you somewhere call a function "obj.m" with an 'double' input and this is not allowed we can't help much more if yo...

need help with optimtool

apparently you somewhere call a function "obj.m" with an 'double' input and this is not allowed we can't help much more if yo...

plus de 12 ans il y a | 0