Put a matrix back to zeros (looking for an elegant solution)
Mostrar comentarios más antiguos
Hello,
I have one matrix that is generated withe zeros:
A=zeros(5,4);
And, during the cycle matrix A get different values to make some math. I want that in the end of the cycle the matrix A come back to is original values so it can start it all over. Is there any elegant solution or should i just use the same code that used to initialize the matrix?
Respuesta aceptada
Más respuestas (1)
Sean de Wolski
el 26 de Dic. de 2012
1 voto
That's what I would do. zeros is the most elegant want to create zeros :)
2 comentarios
André Pacheco
el 26 de Dic. de 2012
Sean de Wolski
el 26 de Dic. de 2012
You could write clean() to do this if you wanted, considerably less elegant though...
Categorías
Más información sobre Matrix Indexing 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!