i want to save all the value of variable a from all iterations into a single matrix ?
Mostrar comentarios más antiguos
f=[1 3 5 7 9 11; 2 4 6 8 10 12]; b=[1 2;3 4]; [m n]=size(f); [m c]=size(b);
for k=1:n f1=f(:,k); for i=1:c b1=b(i,:); d=0; for j=1:m
d=d+(f1-(b1)'); a(j)={sum(d)} Lt=sqrt(abs((a{j}))); end end end
Respuesta aceptada
Más respuestas (1)
Andrei Bobrov
el 2 de Jun. de 2014
Lt = sqrt(abs(sum(bsxfun(@minus,f,reshape(b',size(f,1),1,[])))));
1 comentario
salman hayat
el 2 de Jun. de 2014
Categorías
Más información sobre Language Fundamentals en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!