フィルターのクリア

How to remove multiple elements from an array?

19 ビュー (過去 30 日間)
Steven
Steven 2013 年 9 月 18 日
I have an array x which is equal to [1:50].
I am trying to remove all the elements that are divisible by 3, 4, and 5.
I cannot figure this out for the life of me, I'm sure it will involve some sort of For Loop and three different mod functions.
I would greatly appreciate help from anyone!

採用された回答

Azzi Abdelmalek
Azzi Abdelmalek 2013 年 9 月 19 日
編集済み: Azzi Abdelmalek 2013 年 9 月 19 日
a=1:50
a(~mod(a,3)|~mod(a,4)|~mod(a,5))=[]
  1 件のコメント
Steven
Steven 2013 年 9 月 19 日
Thank you so much for your help. I really appreciate it!

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeMatrix Indexing についてさらに検索

タグ

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by