MATLAB help- addition operator



Hello guys

I am writing a simple function to add a cell array type and a double
array type...Is this possible in matlab ...I tried but it gives an
error saying

?? Function 'sum' is not defined for values of class 'cell'.

Error in ==> sum at 41
[varargout{1:nargout}] = builtin('sum', varargin{:});

Error in ==> Bootstrap at 106
xy(k+1) = sum(xy(k),intvls(k)); % building the new shuffled array

Here is the sample code

for i=1:Ntrials
j=randperm((intvls{i}));% randomly reorder the list
intvls=intvls(j);% reorder the intervals
x(1)=data{i}(1);
xy(1)=x(1);
for k=1:length(intvls)
xy(k+1) = xy(k)+ intvls(k);
end;
y{i}=xy;
end

intvls is of cell array type as follows:

whos xy
Name Size Bytes Class

xy 1x1 8 double array

Grand total is 1 element using 8 bytes

whos intvls
Name Size Bytes Class

intvls 1x1 6052 cell array

Grand total is 750 elements using 6052 bytes

Anybody can help pls help...How do i rectify this?...

Thanks in advance

Sriram
.