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]

 채택된 답변

Sean de Wolski
Sean de Wolski 2011년 4월 7일

0 개 추천

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

추가 답변 (1개)

Paulo Silva
Paulo Silva 2011년 4월 7일

1 개 추천

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

카테고리

도움말 센터File Exchange에서 Creating and Concatenating Matrices에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by