Array value replace when change in row
1 view (last 30 days)
Show older comments
I have one row of matrix
A = [ 0 ; 0 ; 0 ; 0 ; 0 ; 0 ; 0 ; 0 ; 0 ; 0 ; 0 ; 0 ; 1 ; 1 ; 1 ; 1 ; 1 ; 1 ; 1 ; 1 ; 1 ; 1 ; 1 ]
the row has only two value 0 and 1. I want the code that will check the row if vaule change in row it will leave the first value change and aftre that it puts 0.
Output ::
A = [ 0 ; 0 ; 0 ; 0 ; 0 ; 0 ; 0 ; 0 ; 0 ; 0 ; 0 ; 0 ; 1 ; 0 ; 0 ; 0 ; 0 ; 0 ; 0 ; 0 ; 0 ; 0 ; 0 ]
Here you can see value of row is change at (13,1) position so it leave the first 1 and remaing 1 is replaced by 0.
Note::: this is example actual row size is 1508 x 1.
Can some one please help me thank you.
0 Comments
Accepted Answer
More Answers (0)
See Also
Categories
Find more on Creating and Concatenating Matrices 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!