How to remove unwanted elements of a array
56 次查看(过去 30 天)
显示 更早的评论
I have two arrays with unwanted data at the beginning and end of each array (Stress and del L). What is an easy way to remove these elements?
0 个评论
回答(1 个)
WAT
2015-10-14
编辑:WAT
2015-10-14
If you want to get rid of indices 1 through 3 (for example) then
array(1:3) = [];
1 个评论
Hyunjung Lee
2021-4-21
Thank you! I am not the original poster, but this helped me with removing array elements specified in an index vector. Before looking at your reply, I tried a(~idx,:) to try to only keep rows other than those specified by an index vector idx, but it didn't work. Thanks again!
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Structures 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!