How to empty cell array?

20 次查看(过去 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(:) = {[]};

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Multidimensional Arrays 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by