matrix operation

sir how to remove a specific element in an row or column matrix that is in a matrix a=[1 3 3 4] how to remove 4Th element so that i need to have answer a=[1 3 3]

 Respuesta aceptada

Sean de Wolski
Sean de Wolski el 7 de Abr. de 2011

0 votos

a = a(1:3); %glass half full
or
a(4) = []; %glass half empty

Más respuestas (1)

Paulo Silva
Paulo Silva el 7 de Abr. de 2011

1 voto

More examples to add to Sean ones
a(end)=[] %remove the last element
a(a~=1 & a~3)=[] %remove all elements different from 1 and 3

Categorías

Más información sobre Creating and Concatenating Matrices en Centro de ayuda 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