-
2 Comments
Khaled Hamed
on 1 Aug 2012
The problem asks to "add" a zero, no mention of append or prepend! Nice general solution though, and a new trick learned ($&0)
Donovan Greene
on 22 Jun 2017
I feel I've overcomplicated my solution
regexprep(x, '(?(?=0[^0]|0$)0|)', '00')
Suggested Problems
-
Sort a list of complex numbers based on far they are from the origin.
5707 Solvers
-
Remove the polynomials that have positive real elements of their roots.
1712 Solvers
-
299 Solvers
-
Create a Multiplication table matrix...
608 Solvers
-
839 Solvers
More from this Author43
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!