How to use unique function to get data only when the number in one row increases
Show older comments
Hello,
I am trying to figure out on how to extract data only when the number in one of the row increases; for example:
a = [1;1;1; 2;3;4;5;6;7;8;9;10;10;10;11;11];
b = rand(16,1);
c = [b,a]
1) i want to extract the b data only when the number in 'a' increases, which are 1, 2, 3, 4, 5, - 10 without taking the data when the number in a is the same.
2) The numbers in a will go back to 1 after it reaches 255, so i want the function to still take the data when the number goes back to 1. this means that only when the number in a are the same in consequtive order then only you remove the repetition
i appreciate your help in this, please let me know if my question is not clear.
Accepted Answer
More Answers (0)
Categories
Find more on Logical 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!