Akzeptierte Antwort

Wan Ji
Wan Ji am 1 Sep. 2021

0 Stimmen

The simple way is
a={'1','2','3','4'};
b = {[a{:}]}
Answer
b =
1×1 cell array
{'1234'}

Weitere Antworten (2)

Walter Roberson
Walter Roberson am 1 Sep. 2021
Bearbeitet: Walter Roberson am 1 Sep. 2021

2 Stimmen

a={'1','2','3','4'}
a = 1×4 cell array
{'1'} {'2'} {'3'} {'4'}
B = {strjoin(a, '')}
B = 1×1 cell array
{'1234'}
stozaki
stozaki am 1 Sep. 2021
Bearbeitet: stozaki am 1 Sep. 2021

1 Stimme

Hi,
a = {'1','2','3','4'};
b = cellstr(replace(strjoin(a),' ',''))
b = 1×1 cell array
{'1234'}

Kategorien

Mehr zu Characters and Strings finden Sie in Hilfe-Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by