MATLAB: How to store the matrix value in cell array cell arrays I have matrix C=100 by 10 and I want to store the values of matrix in cell array. The code is not working. Please help me on this T3=cell(1,10);for k1=1:n T3(k1)=C;end Best Answer If C is a matrix, then you need to use curly braces to access the contents of the cell array T3:T3 = cell(1,10);for k1 = 1:n T3{k1} = C;end % ^ ^ curly braceshttps://www.mathworks.com/help/matlab/matlab_prog/access-data-in-a-cell-array.htmlThe difference is very simple:() parentheses refer to the cells themselves,{} curly braces refer to the cell contents. Related SolutionsMATLAB: Undefined operator ‘*’ for input arguments of type ‘cell’ matrix.metcoef{i} = matrix.metcoef{i} .* -1matrix.metcoef{i} = -matrix.metcoef{i}; % SIMPLER% ^ ^ ^ ^ Use the correct bracketsRead about the different ways to access cell arrays:https://www.mathworks.com/help/matlab/matlab_prog/access-data-in-a-cell-array.htmlRemember:() parentheses access the cells themselves.{} curly braces access the cell contents. MATLAB: Hi sir,please send some basics to understand about saving for loop result cell array,array.Then what is the need to use curly braces,paranthesis for saving result.Where to use those brackets.whether the result are stored inside or outside end stmnt I think the FAQ explains it pretty well: http://matlab.wikia.com/wiki/FAQ#What_is_a_cell_array.3F Related QuestionCell contents reference from a non-cell array object.How to store cell arraysHow to obtain array of strings contained in a cellWhat is difference in cell and structure plz tell me with exampleLoading part of a structure in a .mat fileHow to create a cell array from rows of an existing cell array
Best Answer