Put a matrix back to zeros (looking for an elegant solution)
Show older comments
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?
Accepted Answer
More Answers (1)
Sean de Wolski
on 26 Dec 2012
1 vote
That's what I would do. zeros is the most elegant want to create zeros :)
2 Comments
André Pacheco
on 26 Dec 2012
Sean de Wolski
on 26 Dec 2012
You could write clean() to do this if you wanted, considerably less elegant though...
Categories
Find more on Symbolic Math Toolbox in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!