You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: fy.m
    path of file: ./repos/opt_matlab/第12章/例12.4
    
    the code of the file until where you have to start completion: function d=fy(x,m_center)  %求样本到类中心的距离
[num,c]=size(m_center);

    
function d=fy(x,m_center)  %求样本到类中心的距离
[num,c]=size(m_center);
d=zeros(1,num);
for j=1:num
    for k=1:c
       d(j)=d(j)+(x(k)-m_center(j,k))^2;  %各个样本到各类的距离
    end