No BSD License  

Highlights from
aide mémoire Matlab (seconde édition)

from aide mémoire Matlab (seconde édition) by Jean-Thierry
les m-fichiers de l'aide mémore Matlab seconde édition

ex_find.m
a = rand(3,3)
a1 = a;
[i,j]=find(a1 > 0.5);
for k = 1:length(i)    % mthode trs inefficace
  a1(i(k),j(k)) = 1;
end;
a1
a1 = a(:);
a1(find(a1 > 0.5))=1;  % mthode lourde
a1 = reshape(a1,3,3)

a1(a1 > 0.5)=1         % meilleure mthode

Contact us at files@mathworks.com