how to create this vector?

조회 수: 1 (최근 30일)
benghenia aek
benghenia aek 2019년 1월 30일
편집: James Tursa 2019년 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]
  댓글 수: 4
benghenia aek
benghenia aek 2019년 1월 30일
Fangjun Jiang if you have answere to my question then give it to me please
Walter Roberson
Walter Roberson 2019년 1월 30일

댓글을 달려면 로그인하십시오.

채택된 답변

Andrei Bobrov
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);
  댓글 수: 1
benghenia aek
benghenia aek 2019년 1월 30일
Andrei Bobrov thank you very much for your answere

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Mathematics에 대해 자세히 알아보기

태그

아직 태그를 입력하지 않았습니다.

Community Treasure Hunt

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

Start Hunting!

Translated by