how can I delete some rows from a matrix
2 次查看(过去 30 天)
显示 更早的评论
Hello,
I have a matrix with 3 col and many rows, I need to to create a new matrix with only odd romws numbers and delet the pair rows.
Someone have an idea how I can do this?
Thank you very much
0 个评论
回答(1 个)
Star Strider
2024-4-5
This creates a new matrix with only the odd rows from the original matrix —
A = randi(9, 10,3)
Anew = A(1:2:end,:)
.
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Matrix Indexing 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!