find the values not existing in this array given below and save it?

1 回表示 (過去 30 日間)
Arunachalam  D
Arunachalam D 2015 年 6 月 14 日
回答済み: Azzi Abdelmalek 2015 年 6 月 14 日
p1=[8 11 13 6 18 16 10 5 3 4];
p2=[1 7 2 6 16 12 4 10 9 8];
between these two arrays p1 and p2 i wanna get the values not existing between range 1:20 and save in an array [ans] for the above array ans should be [14 15 17 19 20]

採用された回答

Azzi Abdelmalek
Azzi Abdelmalek 2015 年 6 月 14 日
p1=[8 11 13 6 18 16 10 5 3 4];
p2=[1 7 2 6 16 12 4 10 9 8]
a=setdiff(1:20,[p1,p2])

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeData Types についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by