merge number and character

1 visualizzazione (ultimi 30 giorni)
huda nawaf
huda nawaf il 4 Mag 2012
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

Risposta accettata

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

Più risposte (1)

Kye Taylor
Kye Taylor il 4 Mag 2012
If
x = 3; y = '-';
merge with
[num2str(x),y]

Categorie

Scopri di più su Creating and Concatenating Matrices in Help Center e File Exchange

Tag

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by