Azzera filtri
Azzera filtri

How to add arrays (horz. with different dimensions/size)

2 visualizzazioni (ultimi 30 giorni)
Hello :) Another simply question (but not for me)
I will add 2 arrays horizontal. See Code. Ok it works in general. But it does not work if I have:
  • array1= 1*9 string array
  • array2= 7*1 string array
How can i create an 1*16 string array? Thank for further help.
array_combination=horzcat(array1,array2)

Risposta accettata

madhan ravi
madhan ravi il 9 Lug 2020
[array1, array2.']
  2 Commenti
madhan ravi
madhan ravi il 9 Lug 2020
Modificato: madhan ravi il 9 Lug 2020
Alternatively:
[array1(:); array2(:)].'
madhan ravi
madhan ravi il 9 Lug 2020
array_combination=horzcat(array1,array2.') % .' was missing

Accedi per commentare.

Più risposte (0)

Categorie

Scopri di più su Characters and Strings in Help Center e File Exchange

Tag

Community Treasure Hunt

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

Start Hunting!

Translated by