MATLAB: I have a 48*48*3 matrix , i want to convert it to 48*48 matrix where each element of the matrix will show a list of 3 characters in a cell. how to do it matrix for eg- i need this matrix to look like {1,9} {2,7} {3,8}……. Best Answer For all the numbers, you can try this:[rows, columns, numSlices] = size(m);index = 1;ca = cell(1, rows*columns); % Preallocatefor row = 1 : rows for col = 1 : columns ca{index} = m(row, col, :); index = index + 1; endend Related SolutionsMATLAB: 48 Dimensional Euclidean Distance. Most of all the components should not be stored in x1, y1, z1, ... but is vectors x1=[1 x 48], x2=[1 x48]. Then some alternatives:x1 = rand(1, 48);x2 = rand(1, 48);x12 = x2 - x1;Dist1 = sqrt(sum(x12 .^ 2))Dist2 = sqrt(x12 * x12.') % DOT product calculates the sum internallyDist3 = norm(x12) MATLAB: How to reduce rows to column Use the reshape (link) function. Related QuestionFor same Matrix subtraction between rowsRandom matrix with maximum values.Invalid expression…Line 16 column 48Sorting the rows of a 2-column matrix based on entries from one column.Matlab Gui Column Calculation Problems adds 48
Best Answer