Put a matrix back to zeros (looking for an elegant solution)
Ältere Kommentare anzeigen
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?
Akzeptierte Antwort
Weitere Antworten (1)
Sean de Wolski
am 26 Dez. 2012
1 Stimme
That's what I would do. zeros is the most elegant want to create zeros :)
2 Kommentare
André Pacheco
am 26 Dez. 2012
Sean de Wolski
am 26 Dez. 2012
You could write clean() to do this if you wanted, considerably less elegant though...
Kategorien
Mehr zu Matrix Indexing finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!