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 次查看(过去 30 天)
显示 更早的评论
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 个评论
采纳的回答
KSSV
2016-6-6
K = rand(10) ;
L = rand(10) ;
col = [1 3 7 10] ; % columns to be replaced
L(:,col) = K(:,col) ;
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Creating and Concatenating Matrices 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!