Hello community of stackoverflow,
I have a cell array Q, 5520x1 cell array, which consists of arrays like this for example:
K>> Q{1}
ans =
0 3 1 84
and so on.
I'd really like to know, how would it be possible to check if an element of the cell array,like the above, already exists in Q? Because if it does exist, i do not add anything, but if yes, i had to add this element to the end of Q. How could this check be done properly? Short solutions, if possible of course, would be a little more appreciated.
Thanks in advance for your time, Nick
I'm assuming that by "element" you mean the whole vector. So for example, given
the new vector
[2 4 3]
should be added, but[4 5]
should not.To do that check: denoting the new vector by
new
, useExamples: