As you know MATLAB stands for matrix laboratory. I like to know, how we can program with matrix method to gain less time duration.

for example how we can implement for loops with matrix?

  • %x->row:attribute  column:instance
  • Distance=zeros(size(x,2));
  • for i=1:n
  •    for j=1:n
  •        Distance(i,j)=sum(abs(x(:,i)-x(:,j)))/numel(x(:,i));
  •    end
  • end
  • and other situation that we can program better in MATLAB.

    More Reza Sadeghi's questions See All
    Similar questions and discussions