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 个评论
DURGA PRAJAPATI
DURGA PRAJAPATI 2021-9-7
Thankyou for your reply.
Actually there was problem in calling the function .But I have resolved .

请先登录,再进行评论。

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Multirate Signal Processing 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by