Questions tagged [fminsearch]

For questions about the Matlab function fminsearch that computes the unconstrained minimum of a given function with the Nelder-Mead algorithm.

SYNOPSIS

x = fminsearch ( costf , x0 )
x = fminsearch ( costf , x0 , options )
[x,fval,exitflag,output] = fminsearch ( costf , x0 , options )

Description

This function searches for the unconstrained minimum of a given cost function.

The provided algorithm is a direct search algorithm, i.e. an algorithm which does not use the derivative of the cost function. It is based on the update of a simplex, which is a set of k>=n+1 vertices, where each vertex is associated with one point and one function value. This algorithm is the Nelder-Mead algorithm.

source

122 questions
1
vote
0 answers

Save values that are calculated in a function for each iteration of fminsearch

I want to find the Minimum of a function using [x,fval] = fminsearch(@(param) esm6(param,identi),result(k,1:end-1),options) now for each Iteration step i want some values that the function 'esm6' calculates to be saved in an Array. I tried the…
Max
  • 1,471
  • 15
  • 37
1
vote
0 answers

Matlab fmincon inital guess trouble

I am trying to calculate the minimum of a function with multiple variables, the only constraints I have are the upper and lower bounds of the variables. The problem I am having is that fmincon does not change the input value from the initial guess…
1
vote
1 answer

Finding optimal waveform overlap in Matlab

I'm trying to see some examples of how to find the optimal overlap between two waveforms. Here is some example data. x1 = [108.1 108.2 108.3 108.4 108.5 108.6 108.7 108.8 108.9 109.0 109.1 109.2 109.3 109.4 109.5 109.6]; y1 = [0 0 2 6 7 6 2 -5 -6 -5…
CodeGuy
  • 28,427
  • 76
  • 200
  • 317
1
vote
2 answers

Use fminsearch to find local minimizer and the minima at that value

I am having trouble using fminsearch: getting the error that there were not enough input arguments for my function. f = @(x1,x2,x3) x1.^2 + 3.*x2.^2 + 4.*x3.^2 - 2.*x1.*x2 + 5.*x1 + 3.*x2 + 2.*x3; [x, val] = fminsearch(f,0) Is there something wrong…
1
vote
0 answers

fitting with complex function

I have to find a model that fits a experimental data. The issue is that the model is a complex function. I have to minimize the error between the model and the experimental data, both for the real part and the imaginary part. I'm using fminsearch…
1
vote
1 answer

fminsearch multiple parameters matlab

I'm trying to use fminsearch with multiple parameters but I can't seem to even get it working with two. I've also tried using optimization tool in matlab but then I get: Optimization running. Error running optimization. Not enough input arguments.…
Joanna
  • 54
  • 1
  • 1
  • 7
1
vote
1 answer

fminsearch to optimise n'th output in Matlab

Is there an elegant way to call fminsearch to optimise the n'th output of a function? or would one need to define a new function that returns the n'th output of the original function and apply fminsearch to this new function? EDITED FOR…
John
  • 21
  • 4
1
vote
0 answers

How to find local minimum of differentiation of a function using MATLAB

I have an exercise that uses Matlab to program a function to approximate a solution of function using fixed-point iteration method and a tolerance. However, I'm getting stuck at calculate the local minimum of first differentiation of a function.…
khôi nguyễn
  • 626
  • 6
  • 15
1
vote
1 answer

How much curve should be shifted to minimize the difference using fminsearch

I have two data sets and if I plot them then they appear like sin waves as you can see I want to move one curve in order to overlap on other one. I want to using fminsearch to find a shift to minimize their difference. I have numerical data and I…
User1551892
  • 3,236
  • 8
  • 32
  • 52
1
vote
1 answer

How do I use fminsearch to solve this 4-variable objective function (matlab)?

I have an objective function that has 4 variables to solve for so that the output is minimal and I am having trouble understanding the syntax required to use the function "fminsearch" for solving for more than one variable. Here is my objective…
buffalonian
  • 13
  • 1
  • 4
1
vote
0 answers

Matlab: fminsearch for functions that do not vary continuously

I have a sequence of chars that I multialign with the Matlab function 'multialign'. The result is a char matrix with the multialigned sequences: e.g. with only 3 seqences. ----GC AT--GC ATGCGC Next I score every column of the alignment on the base…
Marco
  • 1,454
  • 1
  • 16
  • 30
1
vote
1 answer

MatLab fmin function

I have an .m file in matlab named PowerMinimiser and two functions in it function PowerMinimiser PowerOut = fmin(minFunction,0,100); display(PowerOut) end and function PowerOut = minFunction(varargin) RunMode = 2; ThresholdValue =…
thomashs87
  • 59
  • 2
  • 4
1
vote
2 answers

matlab: constrained fit with lsqcurvefit and fmincon

I have a set of data points (data_x, data_y). I need to fit a model function into this data. Model is a function of 5 parameters, and I have defined it like that: function F = model(x,xdata) fraction1 = x(4); fraction2 = x(5); fraction3 =…
Art
  • 1,196
  • 5
  • 18
  • 34
1
vote
1 answer

Error while using fminsearch

I am using fminsearch to minimize the error between the covariance at coarse scale and the average of covariance at fine scale by perturbing certain parameters. These are 2 lines of code lines using fminsearch in which I am calling the objective…
user238469
1
vote
0 answers

undefined variable multivariable fminsearch

Here are my equations: (only the deflection and M(moment) equations are important) M=@(x,F) -(w/2)*(x.^2) + F*x + Fb*(x-L/2).*heaviside(x-L/2); deflection=@(x,c1,c2,F) (1/EI)*(-w*(x.^4)/24 + F*(x.^3)/6 + (1/6)*Fb*((x-L/2).^3).*heaviside(x-L/2) +…
1 2 3
8 9