How to remove unwanted elements of a array
36 ビュー (過去 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!