set intervals with starts and ends in two arrays
4 次查看(过去 30 天)
显示 更早的评论
I know this should be quite an easy answer, but I cannot find the solution: I have two arrays one marks the beginning of the intervals the other sets the ends. so:
starts = [ 1 20 30 40];
ends = [3 22 34 41];
with the ends always ending before the next start. I would like to get an array intervals which should appear either:
intervals = [1 2 3 20 21 22 30 31 32 33 34 40 41];
or:
intervals = [1 2 3; 20 21 22; 30 31 32 33 34; 40 41];
this sounds so dumb to me that I cannot find a way...anyway, I hope somebody can easily help me thanks.
Also, I need to AVOID FOR CYCLES TO DO IT.
3 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Logical 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!