Problem 44031. Matrix Manipulation
Given an m*n matrix, see if a matrix contains any 0s in any row. if it contains 0 anywhere in any particular row, delete that row and fill that row with random integer values between 3 to 15. For example: mat = [3 2 1 3; 3 0 0 1; 0 4 3 1]; answer = [3 2 1 3; 4 7 5 12; 4 9 10 14]
Solution Stats
Problem Comments
-
1 Comment
goc3
on 25 Jan 2017
The test suite of this problem has been updated to actually check for numbers in the specified range (between 3 to 15), so your random solutions should now work.
Solution Comments
Show commentsProblem Recent Solvers38
Suggested Problems
-
7225 Solvers
-
Find the sum of the elements in the "second" diagonal
1200 Solvers
-
Flag largest magnitude swings as they occur
689 Solvers
-
423 Solvers
-
Back to Basics - Find no. of elements in a matrix?
325 Solvers
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!