concatenating certain columns of a (numeric) matrix. The id of columns of interest stored in a numeric array. Also some columns are selected more than once.
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
Matt Talebi
am 6 Jun. 2016
Kommentiert: Matt Talebi
am 6 Jun. 2016
I have a numeric matrix A. I want to generate matrix B (with the same size as A) from certain columns of matrix A. Columns of interest are specified in an array and some columns in B are repeated more than once.
0 Kommentare
Akzeptierte Antwort
KSSV
am 6 Jun. 2016
K = rand(10) ;
L = rand(10) ;
col = [1 3 7 10] ; % columns to be replaced
L(:,col) = K(:,col) ;
Weitere Antworten (0)
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!