MATLAB: Convert cell to matrix convert cell to matrix I have the following {'128' '256' '157' '54'} How can I convert it to a numeric matrix for example 128 256 157 54 Best Answer str2double() Related SolutionsMATLAB: Convert cell array to vector S = load('timestamps.mat');T = vertcat(S.ans{:})T = 1249×1 string array "16:44:28.637" "16:44:28.669" "16:44:28.685" "16:44:28.701" "16:44:28.717" "16:44:28.733" "16:44:28.765" "16:44:28.781" "16:44:28.797" "16:44:28.813" "16:44:28.829" "16:44:28.957" "16:44:28.988" "16:44:29.005" "16:44:29.021" "16:44:29.037" "16:44:29.068" "16:44:29.085" "16:44:29.101" "16:44:29.116" "16:44:29.132" "16:44:29.164" "16:44:29.181" "16:44:29.196" "16:44:29.212" "16:44:29.228" "16:44:29.260" "16:44:29.276" "16:44:29.292" "16:44:29.308" M = seconds(mean(diff(duration(T,'InputFormat','hh:mm:ss.SSS'))))M = 0.0206 MATLAB: Convert cell to time or double Join the cell string to a string at first, then parse it by sscanf:C = {'000:00h:00min:23:743:990µs', '000:00h:00min:23:743:990µs'};S = sprintf('%s*', C{:});V = sscanf(S, '%d:%dh:%dmin:%d:%d:%dµs*', [6, inf]); Related QuestionHow to convert a cell containig 8bit niary sequence to integer valueHow to convert 66 x 2 cell array into matrixConvert String (cell) tableConvert binary to hex
Best Answer