merge number and character

1 回表示 (過去 30 日間)
huda nawaf
huda nawaf 2012 年 5 月 4 日
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
  1 件のコメント
Image Analyst
Image Analyst 2012 年 5 月 4 日
Explain why you want that.

サインインしてコメントする。

採用された回答

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

その他の回答 (1 件)

Kye Taylor
Kye Taylor 2012 年 5 月 4 日
If
x = 3; y = '-';
merge with
[num2str(x),y]

カテゴリ

Help Center および File ExchangeMatrix Indexing についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by