merge values of a vector

조회 수: 5 (최근 30일)
Felix Florath
Felix Florath 2020년 1월 19일
댓글: Felix Florath 2020년 1월 19일
Hey matlab community,
I want to merge the values of a vector to a single scalar. So for example i have the vector z = (1,2,3,4). The final value should be 1234.
Thanks in advance

채택된 답변

Akira Agata
Akira Agata 2020년 1월 19일
Like this?
x = 1:4; % sample input array
s = num2str(x,'%d');
y = str2double(s);
>> y
y =
1234
  댓글 수: 1
Felix Florath
Felix Florath 2020년 1월 19일
Awsome, it works exactly as i needed. Thank you

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Data Type Conversion에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by