MATLAB: Hello everyone, help for consolidation of numbers double Hello everyone, I would like your help in the following : How can i convert A = [1,2,3,4,5,6……n] to B = [123,456,……n],…….. ??? thanks in advance..!! Best Answer One convoluted way of doing this would be to convert to strings and back.for i = 1:length(A)/3 B(i) = str2num([num2str(A(3*i-2)),num2str(A(3*i-1)),num2str(A(3*i))]);end Related SolutionsMATLAB: How to concatenate an array of numbers without for loop >> A = [1,2,3];>> str = sprintf(', %d',A);>> str = sprintf('(%s)',str(3:end))str = (1, 2, 3) MATLAB: Hello, everyone, i have the following problem I assume your date_num values are datenums?How about something like:wd = weekday(date_num + i);if wd == 1 i = i + 1;elseif wd == 7 i = i + 2;end Related QuestionHow to Add the Individual digits of a resultHello everyone, I am facing one problem,I need to rewrite numbers of variable to vector.Hello everyone, i have this urgent problemHow could numbers be displayed only in 4 digits (also in answer of sprintf)Hello everyone, i have the following problem:-
Best Answer