how to create this vector?
1 次查看(过去 30 天)
显示 更早的评论
i have two vectors X and Y:
X=[0 0 0 1 1 1 1 0 0 1 1 0 0 0 1 1 1 1]
Y=[3 6 5]
i want to creat vector Z
Z=[0 0 0 3 3 3 3 0 0 6 6 0 0 0 5 5 5 5]
采纳的回答
Andrei Bobrov
2019-1-30
X=[0 0 0 1 1 1 1 0 0 1 1 0 0 0 1 1 1 1];
Y=[3 6 5];
Y2 = [0,Y];
out = Y2(bwlabel(X) + 1);
更多回答(0 个)
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!