Error minimization by optimizing the parameter value using fminunc
1 次查看(过去 30 天)
显示 更早的评论
function obj = objFunction(q)
data=readtable('solu6_deleted few rows VALUE-Mat1');
A=table2array(data);
size(A)
TF1 = A(:,32)<=0.0001;
A(TF1,:) = [];
size(A)
TF2 = A(:,2)<=0.0001;
A(TF2,:) = [];
size(A)
yex=A(:,33);
x1=A(:,1);
x2=A(:,2);
f1=A(:,4);
f2=A(:,5);
T=A(:,3);
size(T)
yp=@prediction;
obj=norm(yex(':') - yp(':')).^2 ;
---------------------------------------------------
function yp = prediction(q,f1,f2,x1,x2,T)
% Unknown parameter
Q1=q(1);
Q2=q(2);
Q3=q(3);
yp=f1.*log(x1)+f2.*log(x2)+(Q1+Q2.*(f1-f2)+Q3.*(f1-f2).^2).*f1.*f2.*T./298;
what is the wrong with this code ..can anyone please help me ,if any additional info required i will share.
Basically i want to minimize the obj value by optimizing the Q1,Q2,Q3 value using fminunc.
please help me i am new to this software.
3 个评论
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Multirate Signal Processing 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!