Creating an array from 2 other arrays
4 次查看(过去 30 天)
显示 更早的评论
I need a code that will do the following: Given an array X and another array Y which is smaller than X and every element in Y exists in X, I need to create a third array Z which consists of every element that is in X and NOT in Y.
For example, if X = [1 2 3 4 5] and Y = [1 2 3] then I want the code to return an array Z = [4 5].
Can anyone help write this code for me? I've been trying to do it using the 'find' function but can't get it to work. Thanks for the help.
0 个评论
采纳的回答
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Cell Arrays 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!