Help with removing duplicate sub-elements....
Show older comments
Hi, I have a vector a1 and want to get an output a2. Basically, i should identify the starting index of numbers, keep the first value and replace the repeating elements as NaN. I have no idea how to start since i am new to Matlab. Can someone please help?
a1=[-2 -2 -2 -2 NaN NaN NaN -3 -3 -3 -3 NaN NaN -2 -2 -2 NaN -3 -3 NaN NaN 1 1 1 1 NaN NaN 4 4 4 NaN NaN 3 3 3 NaN];
a2=[-2 NaN NaN NaN NaN NaN NaN -3 NaN NaN NaN NaN NaN -2 NaN NaN NaN -3 NaN NaN NaN 1 NaN NaN NaN 4 NaN NaN NaN NaN 3 NaN NaN NaN];
Accepted Answer
More Answers (0)
Categories
Find more on Correlation and Convolution 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!