Fminsearch Matlab (Non Linear Regression )

喜你入骨 提交于 2019-12-03 21:15:23

You want to find the parameter k that will minimize the sum of squared error of your exponential model (BTW, is that a current/voltage characteristic?) given the current data I and voltage data V as vectors:

Imodel = @(V,k) 1E-9*(exp(38.68*V/k)-1);
k0     = 1;
kmodel = fminsearch(@(k) sum((I(:)-Imodel(V(:),k)).^2), k0);

plot(V(:), I(:), 'ok', V(:), Imodel(V(:),kmodel), '-r');

The anonymous function calculates the sum of squared error. The search for the parameter k that will minimize the model error starts with the value 1; please change it to a more appropriate value (if you have a good guess for it).

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!