MATLAB: How to convert a 1D vector in number MATLABvector to number conversion e.g barcode=[8 9 0 2 0 8 0 0 1 1 4 4 5] How i get A=8902080011445 ?? Best Answer >> barcode = [8 9 0 2 0 8 0 0 1 1 4 4 5];>> n = polyval(barcode,10)n = 8902080011445Or, without polyval:>> n = sum(barcode .* 10.^[(numel(barcode)-1):-1:0])n = 8902080011445Note that this assumes all elements of barcode are single-digit. If this is not the case, but you want something similar, this would work:>> barcode = [8 9 0 2 0 8 0 0 1 1 4 86 5];>> n = str2num(regexprep(num2str(barcode),' ',''))n = 89020800114865 Related SolutionsMATLAB: How to find elements in an array based on a search from another array. ismember(a, b) MATLAB: Reshape cell array into a matrix Assuming that those should be numeric vectors:a{1} = [1 2 3 4 5];a{2} = [2 2 4 5];a{3} = [8 2];a{4} = [8 2 9 9 2 1 3];v = cellfun('size',a,2);r = numel(a);M = zeros(r,max(v));for k = 1:r M(k,1:v(k)) = a{k};endGiving:>> MM = 1 2 3 4 5 0 0 2 2 4 5 0 0 0 8 2 0 0 0 0 0 8 2 9 9 2 1 3>> Related QuestionProblem plotting random vectorError using sprintf Function is not defined for ‘System.String’ inputs.Cell and Mat problemIs the polyval command giving two different answersI want to change [3,2,4](1×3 matrix) to 324(1×1 matrix) any help
Best Answer