relationship between 2 matrix

4 visualizaciones (últimos 30 días)
ha ha
ha ha el 13 de Abr. de 2018
Respondida: Matt J el 13 de Abr. de 2018
A, B is matrix:
A=[1;2;3;4;5;6;7;8;9];
B=[2;4;7;9];
How to find matrix C as follow?
C=[1;[];3;[];5;6;[];8;[]];%the location of matrix B from A will be replaced by [] value

Respuesta aceptada

Matt J
Matt J el 13 de Abr. de 2018
C=A;
C(B)=[]

Más respuestas (1)

Matt J
Matt J el 13 de Abr. de 2018
If you mean that [] actually must reside in those spots, it can only be done with a cell array
C=num2cell(A);
C(B)={[]}

Categorías

Más información sobre Statistics and Machine Learning Toolbox en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by