making rectangular matrix by non rectangular matrix by putting zeros
Show older comments
Hello, I have a text file data which every row has different numbers which the longest is 17 numbers. If the number of rows be n, how may I make a matrix n*17 which put zero at the end of those rows which have fewer numbers than 17? As an example this data which should be 10*17 matrix.
1 1
2
3 2 2 4 2 2 2 3 3
5
1
6
1 1
6
6 7 7 7 6 6 8 8 8 8 6 7 7 7 6 6 8
6 9 4 4 4 10 3 10 5 10 4 4 4
Accepted Answer
More Answers (0)
Categories
Find more on Cell Arrays 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!