一组中的元素不是另一组中的元素(相对补码) [英] Elements in a set that are not elements of another set (relative complement)

查看:112
本文介绍了一组中的元素不是另一组中的元素(相对补码)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

matlab中,我如何实现以下目标?

In matlab, how can I implement the following?

说我有一组A和另一组B,这两个都有一些元素.我该如何编写一个只返回A不是B值(B B\A中A的相对补码)的函数?

Say that I have some set A and another set B, both of which have some elements. How can I write a function that returns only the values of B that are not in A (relative complement of A in B B\A?

谢谢.

推荐答案

使用 setdiff

dif = setdiff( A, B )

这篇关于一组中的元素不是另一组中的元素(相对补码)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆