Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
curve fit toolbox and custom cost function

Subject: curve fit toolbox and custom cost function

From: Steve Sachay

Marcus Glover

(Steve Sachay)

Date: 24 Mar, 2011 18:02:05

Message: 1 of 1

Hello. I'd like to use the curve fit toolbox's robust regression methods for nonlinear fitting.

However, I also want to modify my cost function to minimize the distance between the datapoints and and the average value of the model curve over a time period, rather than the taking the value of the model at the corresponding timepoint. So if I have a data point at t=5 representing the first 10 minutes of data, I want to compare the datapoint and the average value of the fit curve over 0-10 minutes, not the value of the fit curve at t=5. (so I'd just integrate the curve and divide by the domain)

Can I do this with the curvefit toolbox? I can't see where I would make a custom cost function.

Tags for this Thread

No tags are associated with this thread.

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us