Filter löschen
Filter löschen

How can I merge two array's?

1 Ansicht (letzte 30 Tage)
Biza Ferreira
Biza Ferreira am 29 Okt. 2015
Kommentiert: Muthu Annamalai am 29 Okt. 2015
I have two array and I want to merge in one . A =['test']; B= [1, 2, 3]; C= ['test', 1, 2, 3];

Akzeptierte Antwort

Adam
Adam am 29 Okt. 2015
{ A, B }
will merge them into a cell array as two distinct cells
[ A, num2cell( B ) ]
will give you a 4-element cell array with the elements of B each in their own cell.

Weitere Antworten (1)

timo
timo am 29 Okt. 2015
N1 = py.list({1,2,3})
N2=py.list({'Lists in python'})
N1.append(N2)
  1 Kommentar
Muthu Annamalai
Muthu Annamalai am 29 Okt. 2015
IMO - bit of an over kill, even if functional.

Melden Sie sich an, um zu kommentieren.

Kategorien

Mehr zu Call Python from MATLAB finden Sie in Help Center und File Exchange

Tags

Produkte

Community Treasure Hunt

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

Start Hunting!

Translated by