Labfans是一个针对大学生、工程师和科研工作者的技术社区。 | 论坛首页 | 联系我们(Contact Us) |
![]() |
|
![]() |
#1 |
高级会员
注册日期: 2008-01-02
帖子: 247
声望力: 22 ![]() |
![]()
function F=findF(u,z,v,m)
%u,z,v是矩阵,m是一个实数. [m1 n1]=size(u); [m2 n2]=size(z); [m3 n3]=size(v); if n1~=n2 error('number of columns of u must equal to that of z') elseif m1~=n3 error('number of rows of u must equal to that of columns of v') else if m2~=m3 error('number of rows of z must equal to that of v') end end for i=1:m1 a(i)=sum(u(i, ![]() for j=1:m2 for k=1:n1 b(k)=u(i,k)^m*(z(j,k)-v(j,i))^2; c=sum(a); end F(i,j)=c/a(i); end end |
![]() |
![]() |