Merge two columns into one column?
Mostrar comentarios más antiguos
I have two columns that i want to merge into one column. Meaning i want
A=[123; 321] and
B=[456; 654] to be merged/combined into a new column
C=[123456; 321654]
I this possible?
Respuesta aceptada
Más respuestas (1)
>> A = [123,321,20001130];
>> B = [456,654,32378];
>> F = @(n)arrayfun(@int2str,n,'UniformOutput',false);
>> cellfun(@(a,b)str2double([a,b]),F(A),F(B))
ans =
123456 321654 2000113032378
Categorías
Más información sobre Creating and Concatenating Matrices en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!