MATLAB: What is the difference between A=[]; and A={};

MATLAB

what is the difference between A=[]; and A={}; ?

Best Answer

One initializes the variable as a double (or array of doubles) and the other as a cell (or a cell array)
>> A=[];
>> class(A)
ans =
double
and
>> B={};
>> class(B)
ans =
cell