How do I delete multiple elements from a column array using a while loop?

For example if I wanted to delete every element in an array where the array is equal to 0?

답변 (1개)

Shubham Gupta
Shubham Gupta 2019년 11월 7일
편집: Shubham Gupta 2019년 11월 7일
This should do the job:
A = [1 0 1 0 1 0 1 0]';
A(A==0) = []

카테고리

도움말 센터File Exchange에서 Loops and Conditional Statements에 대해 자세히 알아보기

질문:

2019년 11월 7일

댓글:

Jan
2019년 11월 7일

Community Treasure Hunt

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

Start Hunting!

Translated by