Given an array with zeros at the beginning or at the end, you should get the output without these zeros:
input = [zeros(5, 1); [1 2 5 1 0 2 5 80]']; output = [1 2 5 1 0 2 5 80]';
or
input = [5 7 6 2 2 0 0 0 0]; output = [5 7 6 2 2];
Solution Stats
Problem Comments
1 Comment
Solution Comments
Show comments
Loading...
Problem Recent Solvers56
Suggested Problems
-
Volume of a sphere given its surface area
155 Solvers
-
Given a matrix, swap the 2nd & 3rd columns
1271 Solvers
-
Simple equation: Annual salary
4265 Solvers
-
Sum of odd numbers in a matrix
620 Solvers
-
If you have matrix A, create matrix B using matrix A as an "element"
129 Solvers
More from this Author4
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
The test suite has fixed and expanded.