Limiting vectors to a certain number of rows
3 次查看(过去 30 天)
显示 更早的评论
Hi, i have created a function that creates n lots of a matrix of 3 columns but different number of rows. How do i limit the number of rows so that each of this matrixes has say 4 rows?
0 个评论
回答(1 个)
Wayne King
2013-12-12
It depends which 4 rows you want to choose out of each of the matrices. Do you always want the first 4 rows?
If so, then in your code after you create the matrix, remove the trailing rows.
X = randn(10,10);
X(5:end,:) = [];
2 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Logical 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!