how to delete all the elements from the matrix?
조회 수: 25 (최근 30일)
이전 댓글 표시
i want to delete all the elements from the matrix, and make the matrix empty.
댓글 수: 1
Walter Roberson
2014년 3월 27일
What data type is the matrix? Should the empty matrix have the same data type?
답변 (3개)
RAGHAVENDRA
2014년 3월 27일
편집: RAGHAVENDRA
2014년 3월 27일
Are you trying to make the matrix as null matrix or want to replace the elements with zeros(erasing the values). In the former case just use A=[];
댓글 수: 0
Jos (10584)
2014년 3월 27일
Several options, depending on the desired result (same class, for instance):
A = []
A(:) = []
A = zeros(0,0,class(A))
댓글 수: 0
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!