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 で Loops and Conditional Statements についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!