how to append "specific columns" in an array
Ältere Kommentare anzeigen
hello ,
i tried so many combinations of codes using reshape and permute function but i couldn't get the desired output
suppose my array looks like
0 0
0 0
1 1
0 1
there are 2 columns and i want to take 1st column and copy it in 2nd and 3rd column , but i want to append it , i dont want to overwrite existing columns
so as a result i want 6 columns
0 0 0 0 0 0
0 0 0 0 0 0
1 1 1 1 1 1
0 0 0 1 1 1
i tried 2 clear my problem .... Can AnyOne Help With This Please??
I am Looking for Generalized code that can work for every array
2 Kommentare
Mischa Kim
am 20 Mär. 2014
Is the very first column supposed to be [0;0;1;0] rather than [0;0;0;0]?
pooja
am 20 Mär. 2014
Akzeptierte Antwort
Weitere Antworten (1)
Chandrasekhar
am 20 Mär. 2014
A = [0 0 0 0;0 0 1 0;1 1 1 1;0 1 0 1];
appending 1st column of A at the end|
A = [A A(:,1)];
1 Kommentar
pooja
am 20 Mär. 2014
Kategorien
Mehr zu Logical finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!