How to empty cell array?

조회 수: 8 (최근 30일)
Mohammed
Mohammed 2013년 5월 22일
Hi all
How to empty cell array?
I have a problem that every loop results overwrite the one before so I am trying to empty the cell array every loop so when it comes to successive loop the previous results not interfering the last results. Any help?

채택된 답변

the cyclist
the cyclist 2013년 5월 22일
It will depend on exactly what you mean by "empty", but if your cell array is named c, then this command
c(:) = []
will make c into an empty cell array, and so will
c = {}
  댓글 수: 2
Matt J
Matt J 2013년 5월 22일
편집: Matt J 2013년 5월 22일
Or, depending on what's needed,
c(:) = {[]};
Mohammed
Mohammed 2013년 5월 23일
Thanks a lot

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Matrices and Arrays에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by