for i=1:length(no) Distance=[]; k=0;end for j=1:length(no) if j~=i sum_squ_diff=sum((stock(i).price-stock(j).price).^2); Distance(k,:)=[stock(j).permno, stock(i).permno, sum_squ_diff]; k=k+1; end end
MATLAB: How should do i get rid of this error
error
Best Answer