フィルターのクリア

Shorting dissimilar Elements from an Array

1 回表示 (過去 30 日間)
Souarv De
Souarv De 2021 年 5 月 27 日
コメント済み: Souarv De 2021 年 5 月 28 日
Suppose I have an array A of elements from 1 to 20 sequentially. Let B = [10 9 2 4 7 16 17 15 11 13]. I need an array C (Assending Order) containing the remaining elements of A i.e which is not in B.

採用された回答

Matt J
Matt J 2021 年 5 月 27 日
編集済み: Matt J 2021 年 5 月 27 日
A=1:20;
B= [10 9 2 4 7 16 17 15 11 13];
C=setdiff(A,B)
C = 1×10
1 3 5 6 8 12 14 18 19 20
  1 件のコメント
Souarv De
Souarv De 2021 年 5 月 28 日
Thanks You Matt J.

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeCreating and Concatenating Matrices についてさらに検索

製品


リリース

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by