MATLAB: Taking two matrices and outputting as a single number with one matrix being the integer value and one being the decimal value.

matrix

Let's say I have two matrices: [1 2 3] and [4 5 6]. I want to output these matrices as a single number: 123.456 …. Is it possible and how should I do it?

Best Answer

a = [1 2 3] ;
b = [4 5 6] ;
iwant = sum(10.^(length(a)-1:-1:0) .* a)+ sum(10.^(length(b)-1:-1:0) .* b)/10^length(b) ;