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 comentarios

benghenia aek
benghenia aek el 30 de En. de 2019
please can anyone solves this problem for me?
Fangjun Jiang
Fangjun Jiang el 30 de En. de 2019
You got to provide some logic or background at least, right?
benghenia aek
benghenia aek el 30 de En. de 2019
Fangjun Jiang if you have answere to my question then give it to me please
Walter Roberson
Walter Roberson el 30 de En. de 2019

Iniciar sesión para comentar.

 Respuesta aceptada

Andrei Bobrov
Andrei Bobrov el 30 de En. de 2019

1 voto

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);

Más respuestas (0)

Etiquetas

Aún no se han introducido etiquetas.

Preguntada:

el 30 de En. de 2019

Editada:

el 30 de En. de 2019

Community Treasure Hunt

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

Start Hunting!

Translated by