I need some help with union two cell arrays.
I have:
data{1} = 'alon' 'shmiel'
values{2} = 'Image' 'Area'
I want to merge them into a union, so that data{1} first and values{2} second:
'alon' 'shmiel' 'Image' 'Area'
I tried:
-
values{2} = {data{1}(1:2),'Image', 'Area'};
but I got:{1x2 cell} 'Image' 'Area' -
union(data{1},values{2})
but I got:'Area' 'Image' 'alon' 'shmiel' -
union(data{1},values{2},'stable')
but I got an error:Warning: Third argument is ignored for cell arrays.
Thank you guys!
Do you really want a union (i.e. only unique values)? Or do you just want to concatenate the arrays, as suggested by your first attempt?
If you just want to concatenate, try