row by row minimization
显示 更早的评论
Hello,
I am relatively new to programing. I have written the following function to be optimized by another MATLAB function that I found online:
function z = PSO_inv(x)
DM=dlmread('DM.dat','\t',1,0);
mp=length(DM);
for i=1:mp
DC(i,:)=forward_p(x);
end
t=0;
for k=1:4
for i=1:mp
t = t + (((DM(i,k)-DC(i,k))/DM(i,k))^2);
end
end
z=100*sqrt(t/4);
end
I have two matrices DM and DC, both are 206x4, and would like to minimize the difference row by row, but I think my code now tries to do the optimization for the whole dataset at once.
Thank you, any help is appreciated!
2 个评论
Jan
2018-2-20
What is "forward_p"? What is "x" and the contents of "DM"? What exactly does "minimize the difference row by row" mean?
回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Parallel Computing Toolbox 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!