Rearrange matrix and combination issues

1 view (last 30 days)
Dai Tran
Dai Tran on 26 Nov 2018
Commented: Dai Tran on 26 Nov 2018
I have 10 matrix(1x7) (Ei, i=1:10) like this
Firstly, I want to combine to make a new matrix with 2 column [E1,E2] [E1,E3] ... [E1,E10]
and then arrange it into 1 matrix like the image below.
How can I make a loop for this problem?
Thanks
  6 Comments
madhan ravi
madhan ravi on 26 Nov 2018
Does this do the job?
a=reshape([T(:,1) T(:,3)],7,[]);
a=a(:);
desired=[repmat(a(1:7),9,1) a(8:end)]
Dai Tran
Dai Tran on 26 Nov 2018
Thank you for your help.
it's really useful.

Sign in to comment.

Answers (1)

KALYAN ACHARJYA
KALYAN ACHARJYA on 26 Nov 2018
col1=xlsread('text.xlsx','B:B');
col2=xlsread('text.xlsx','D:D');
new_text=[col1 col2];
xlswrite('new_text',new_text);
  2 Comments
madhan ravi
madhan ravi on 26 Nov 2018
The OP wants to match E1 with all the E's
Dai Tran
Dai Tran on 26 Nov 2018
Sorry, but I want more than that.
I want to create the function to automatically match and combine the matrix like what I present above.
Thanks for your time.

Sign in to comment.

Community Treasure Hunt

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

Start Hunting!