0

I have a Matlab function (of 10 independent variables) based on a model (which generates an oscillating curve with varying period). I need to suitably vary the variables to fit measured data to extract model parameters.

The measured data is a two column vector, M (L, P). The model function is P = ModelFunction (L, a, b, c, d....), where a, b, c, d...are the independent variables which needs to be varied to match the measured data.

I do not have Matlab's optimization toolbox. Is there a Matlab function which can already do this. Else please could someone guide me on how to to approach this problem?

jam_27
  • 35
  • 1
  • 7
  • Your question is very vague (see [ask]). The desired input /output relation is not clear. Edit your question and add all necessary information. – Irreducible Oct 23 '17 at 10:32
  • The function nlinfit() in Matlab's "Statistics and Machine Learning Toolbox" seems to be able to do what I need. Unfortunately, I do not have Statistics and Machine Learning Toolbox either. Is there an alternative function to nlinfit () available? – jam_27 Oct 23 '17 at 11:05
  • In this [answer](https://de.mathworks.com/matlabcentral/answers/126146-curve-fitting-without-the-toolbox) someone suggests to use `fminsearch` by building your own ordinary Least Squares cost function. Have a look whether this helps you – Irreducible Oct 23 '17 at 12:15
  • Thanks, I have tried this. But fminsearch does not seem to like it if there is a loop on the number of data points in my objective function. I have just explained the issue in more detail here [link]https://uk.mathworks.com/matlabcentral/answers/362940-fit-model-to-measured-data-without-toolbox). Any direction would be very useful. – jam_27 Oct 24 '17 at 11:14
  • The suggested method using fminsearch needs a scalar function. My model function returns a vector. What are my options for a vector function? – jam_27 Oct 24 '17 at 13:22
  • You need to design a cost / objective function depending on your needs. The amount of input parameters is rather secondary, you need to evaluate the quality of your estimated parameters in one value. – Irreducible Oct 24 '17 at 13:48

0 Answers0