find location of indexes - MATLAB Cody - MATLAB Central

Problem 47663. find location of indexes

Difficulty:Rate
Given a vector with integer values.
Find the edge location of the stream of same value.
For example:
A=[0 0 0 1 1 1 1 2 2 2 1 1 1 15 15 15]
and we are looking for edges of sequence of 1s
The output shall be:
regions = [4 7; 11 13]

Solution Stats

41.79% Correct | 58.21% Incorrect
Last Solution submitted on Jan 25, 2025

Problem Comments

Solution Comments

Show comments

Problem Recent Solvers23

Suggested Problems

Problem Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
Go to top of page