How to reshape two matrices row wise with out changing the order

1 view (last 30 days)
Hi,
I have below two matrix (cell array matices):
A={'KAL' '29' '56' 'norespose' '90';'GYT' '69' '14' 'respose' '1';'2' '10' '14' '45' '150'};
B={'PAY' 'JAK' '12' '11' '9';'4' '111' '171' '13' '222';'2' '10' '14' '45' '340'};
My desired output:
[KAL 29 56 norespose 90 PAY JAK 12 11 9 GYT 69 14 respose 1 4 111 171 13 222 2 10 14 45 150 2 10 14 45 340];
I useed: Areshape=reshape(A',1,15);
Breshape=reshape(B',1,15);
and AB=[A;B];
But I can not get my desired output.
1. I want do: [row1_A row1_B row2_A row2_B row3_A row3_B];

Accepted Answer

Stephen23
Stephen23 on 2 Oct 2017
reshape([A,B]',1,[])

More Answers (0)

Community Treasure Hunt

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

Start Hunting!