comparing the missing value

I have a vetor
a= [3 4 5 1 9 2 0]
b= [4 0 5 9 1 2]
b matrix miss value
compare two matrix..
The missing value added to the b from a

回答 (2 件)

pietro
pietro 2014 年 4 月 26 日
編集済み: pietro 2014 年 4 月 26 日

0 投票

Here one solution:
a= [3 4 5 1 9 2 0];
b= [4 0 5 9 1 2];
b=b(find(ismember(a,intersect(a,b))==0))

1 件のコメント

Anusha
Anusha 2014 年 4 月 26 日
Its not working

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

Azzi Abdelmalek
Azzi Abdelmalek 2014 年 4 月 26 日

0 投票

a= [3 4 5 1 9 2 0]
b= [4 0 5 9 1 2]
out=setdiff(a,b)

カテゴリ

質問済み:

2014 年 4 月 26 日

回答済み:

2014 年 4 月 26 日

Community Treasure Hunt

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

Start Hunting!

Translated by