matlabcell-array

Delete cells from cell array without replacing that by NULL


I have a cell which contains cells, I want to delete specific cell from the cell array but with 'delete' function I am getting error as "Argument must contain a string". For example I have a cell

A= { ['a'] ['b'] ['c'] [1 2 3]} 

Now I want to delete the 3rd value of A that is A(3)='c' such that the new cell A after deleting A(3) will be

A={ ['a'] ['b'] [1 2 3]}

There should not be any null value at the place of deleted value like

A={['a'] ['b'] [] [1 2 3]}

Solution

  • Use parenthesis instead of braces:

    A(1) = [];