i need to convert below batrix to another matrix
Show older comments
b=[308 -1 2 3 -1 2 -1;
-1 -1 2 1 0 1 0;
1 2 -1 -1 -1 -1 2;
0 0 1 -1 -1 2 -1];
to
b=[308 2 3 2 ;
2 1 0 1 0;
1 2 2;
0 0 1 2 ]
fill all ending elements with 0
b=[308 2 3 2 0 ;
2 1 0 1 0;
1 2 2 0 0;
0 0 1 2 0]
thanks
1 Comment
Walter Roberson
on 8 Nov 2019
Is it correct that the rule is that each row should have all negative values removed, and then all rows should be padded out with 0 to the length of the longest remaining row ?
Accepted Answer
More Answers (1)
Nitin Sapre
on 8 Nov 2019
0 votes
Categories
Find more on Data Type Conversion 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!