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 =doubleand>> B={};>> class(B)ans =cell Related SolutionsMATLAB: Check a variable is a symbolic or a double syms a b=10 class(a) class(b) MATLAB: Assigning an empty numeric value to a cell array >>c = {[]};>>class(c{1})ans = double>>isempty(c{1})ans = 1Or if you really want to be specific:c = {double.empty(0)}; Related QuestionDifferenceSet difference between two cell arraysConvert type while keeping valuesWhat’s the difference
Best Answer