MATLAB: Merge number and character

character

hi, how i can merge this x=3 y='-'
when do z=[x y] i get z =
– this symbol is appearing as square in command of matlab i need the result be 3 – how get that?
thanks

Best Answer

You cannot. Anyone one array can be numeric or character, but not both at the same time.
Perhaps you want
z = [num2str(x) y];
Related Question