Replacing values within a row of matrix with a vector?
Show older comments
Basicly I have a matrix with only 0 and 1's.
a = [ 1 0 1 0;...
1 1 0 1;...
0 1 1 0;...
1 1 0 0];
And i want to replace the 1's in the first row with the vector
b = [2 5]
the number of 1's i want to replace will always be the same size as the vector b.
Is there any method for doing this??
Thanks
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!