フィルターのクリア

Not enough input arguments

1 回表示 (過去 30 日間)
Kelly McGuire
Kelly McGuire 2017 年 4 月 12 日
回答済み: Star Strider 2017 年 4 月 13 日
I am not understanding what is wrong with line 10, which is [a,b] = size(t);
function [ diffVec ] = GlobChiSq( p, t, Co, Diff, y )
% For loop that creates difference vector that lsqcurvefit uses to optimize
% p
%This equation has four parameters: p1, p2, p3, and p4. p1 is k1 (on rate
%constant), p2 is k2 (off rate constant), p3 is the length of the unstirred
%layer (L), and p4 is iN (total current).
l = 0;
[a,b] = size(t);
for i = 1:a
for j = 1:b
[c,d] = size(concentration);
for k = 1:d
modelFun = p(4) * ((1 - calcPinf(p,t(i,j,k),Co(k),Diff)) * exp(-calcLambda(p,t(i,j,k),Co(k),Diff) * t(i,j,k)) + calcPinf(p,t(i,j,k),Co(k),Diff));
l = l+1;
diffVec(l) = y(i,j) - modelFun(i,j);
end
end
end
end

採用された回答

Star Strider
Star Strider 2017 年 4 月 13 日
You are calling it as your objective function to lsqcurvefit. The input arguments are specific in all the curve fitting functions.
You need to call it as:
[p,resnorm] = lsqcurvefit(@(p,t) GlobalChiSq( p, t, Co, Diff, y ), startingVals, x, y lb, ub, options)

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeSolver Outputs and Iterative Display についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by