MATLAB: Combining two number to one number

number

Dear Matlab users
Im facing the problem of combining two seperate numbers into one number. Let's say i have the number 1 and 2 and want to combine them in that order, resulting in 12. Another example could be 4 and 6, yielding 46, or 3, 6 and 7 yielding 367.. Is there any smart or simple way of doing this?
Thanks in advance, Poul

Best Answer

a = 1;
b = 2;
c = 3;
result = strcat(num2str(a),num2str(b),num2str(c));
result = str2num(result);
Related Question