MATLAB: Cell operation cell Hi guys, There is a m*1 cell array. In every cell, there are n cells. How can I transform this m*1 cell array to a m*n cell matrix without using loop? Thanks, Zhong Best Answer Maybe something like this?M{1,1} = {1 3 5 0}M{2,1} = {2 4 6 -1}M{3,1} = {7 8 9 2}cat(1,M{:}) Related SolutionsMATLAB: Delete matrix in cell cell_A={[1 1 1] [1 2 3;3 2 1] [4 5 6;7 8 9;1 1 1] [2 2 2;3 3 3] [9 9 9]};cell_B={[1 1 1] [1 2 3;3 2 1] [9 9 9]};m = length(cell_A) ; n = length(cell_B) ; iwant = cell_A ; for i = 1:m for j = 1:n if isequal(cell_A{i},cell_B{j}) iwant{i} = [] ; end endend% Remove empty cellsidx = cellfun(@isempty,iwant) ;iwant(idx) = [] ;celldisp(iwant) MATLAB: Cell operation B = repmat(A, 3, 1); %do the duplicationB = B(:).' ; turn the result in to a row vector Related QuestionRemoving elements from a cell arrayUitable operationHow to create a 1×3 cell array to hold multiple individual arraysMatrix operation
Best Answer