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 CenterFile Exchange에서 Creating and Concatenating Matrices에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by