taking 2 columns from two different matrices and making a new 2 column matrix
6 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
cormac spillane
am 25 Apr. 2015
Beantwortet: dpb
am 27 Apr. 2015
help!! I have 2 different matrices a and b with large sample sizes, i need to take the first column from b and put it into the first column in a new matrix c and take the first column from a and put it into column 2 in matrix c ??
I know theres a simple answer to this, its just every bit of info on this topic just shows when there are small sample sizes! any help regarding this topic would be greatly appreciated
0 Kommentare
Akzeptierte Antwort
Weitere Antworten (1)
dpb
am 27 Apr. 2015
Write it in one step...
c=[b(:,1) a(:,2)];
"... every bit of info on this topic just shows when there are small sample sizes"
Size is totally irrelevant other than the two must be concordant in size in the direction of concatenation (iow, here they must be the same length). An example that demonstrates a principle for a vector length of 3 is just as useful as one of 3 million; just that one can actually visualize the smaller so as a pedagogical tool it is far preferable, in fact.
0 Kommentare
Siehe auch
Kategorien
Mehr zu Creating and Concatenating Matrices finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!