HOW TO USE "INTERSECTION AND UNION" IN MATALB?

2 ビュー (過去 30 日間)
sheeba
sheeba 2013 年 9 月 26 日
コメント済み: Jan 2013 年 9 月 26 日
I HAVE THE CODE N= B union C+|B intersection C|, ->modulus.. please help me... how to use this in matlab..
  2 件のコメント
Roger Stafford
Roger Stafford 2013 年 9 月 26 日
I suggest you read these two Mathworks' websites carefully:
http://www.mathworks.com/help/matlab/ref/union.html
http://www.mathworks.com/help/matlab/ref/intersect.html
Jan
Jan 2013 年 9 月 26 日
編集済み: Jan 2013 年 9 月 26 日
It depends on the types of B, C and D, and the definition of "+" and "modulus" in your case. Is this group theory or are you talking of simple vectors? Is "+" the joining or the addition?
Without clean definitions of the data and operators asking for a conversion to Matlab is not meaningful. Example: How to program the BlöderNasenmann operator to Matlab when it is applied to Quabla Fabla? Although the meaning is clear to me, no reader can have a reliable idea what I'm talking of.

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

回答 (1 件)

ES
ES 2013 年 9 月 26 日
N=union (B,C)+abs(intersect(B,C)) Take a lot of care about matrix dimensions. The intersection matrix is smaller or equal in size as of the two input matrices. Similarly, the union matrix is bigger or equal in size as of the two input matrices. Zero pad or make necessary changes to accommodate size differences.

カテゴリ

Help Center および File ExchangeCell Arrays についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by