fminsearch

Fminsearch Matlab (Non Linear Regression )

喜你入骨 提交于 2019-12-03 21:15:23
Can anyone explain to me how I can apply non linear regression to this equation t find out K using the matlab command window. I = 10^-9(exp(38.68V/k)-1). Screenshot of Equation I have data values as follows: Voltage := [0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0]: Current:= [0, 0, 0, 0, 0, 0, 0, 0.07, 0.92, 12.02, 158.29]: Screenshot of Equation [NEW]: Now I used FminSearch as an alternative another and another error message appeared. Matrix dimensions must agree. Error in @(k)sum((I(:)-Imodel(V(:),k)).^2) Error in fminsearch (line 189) fv(:,1) = funfcn(x,varargin{:}); I used this

Passing a constant to fminsearch

假如想象 提交于 2019-12-03 16:23:09
How can I pass a constant to fminsearch? So like, if I have a function: f(x,y,z), how can I do an fminsearch with a fixed value of x? fminsearch(@f, [0,0,0]); I know I can write a new function and do an fminsearch on it: function returnValue = f2(y, z) returnValue = f(5, y, z); ... fminsearch(@f2, [0,0]); My requirement, is I need to do this without defining a new function. Thanks!!! You can use anonymous functions: fminsearch(@(x) f(5,x) , [0,0]); Also you can use nested functions: function MainFunc() z = 1; res = fminsearch(@f2, [0,0]); function out = f2(x,y) out = f(x,y,z); end end You can

Synchronize intersection points of two pairs of curves with fminsearch

江枫思渺然 提交于 2019-12-01 22:42:18
问题 I have two pairs of curves and every pair has an intersection point at a different time value (x-value). Now I need to move one curve of each pair equally in x-direction until both intersection points have the same time value/x-argument: These are just examples, you can assume the same monotonicity (but maybe different shapes) for all my real cases like in my example. Also curves of the same color have the same x-vector (but not necessarily equidistant ). Between two colors (1=red and 2=blue)