Hello,
for example there are a= [3 5 1] and b = [4 6 7]
How can I combine a and b to get c= [3 4 5 6 1 7]?

 Akzeptierte Antwort

Robert U
Robert U am 30 Sep. 2022

1 Stimme

Hi MIch,
have a look in the documentation under language fundamentals --> reshape()
a = [3 5 1];
b = [4 6 7];
c= reshape([a' b']',1,[])
c = 1×6
3 4 5 6 1 7
Kind regars,
Robert

Weitere Antworten (1)

zhehao.nkd
zhehao.nkd am 30 Sep. 2022

0 Stimmen

Try reshape([a;b],1,[])

Kategorien

Mehr zu Operators and Elementary Operations finden Sie in Hilfe-Center und File Exchange

Tags

Gefragt:

am 30 Sep. 2022

Kommentiert:

am 30 Sep. 2022

Community Treasure Hunt

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

Start Hunting!

Translated by