Hi,
I have the following code in which I calculate the time curve of each non-zero region of my image. In each iteration I would like to store the values of each time-cruve (y) because I wouls also like to plot the average curve of the individual time-curves (sum the individual curves/ number of individual curves).
Below is my code to plot the individual time-curves.
list=unique(p)';list(1)=[];
f=double(r.img).*repmat(p==i,[1,1,1,size(image,4)]);
y=sum(sum(nansum(f,1),2),3);y=y/sum(sum(sum(p==i)));
plot(y(:),'x-','color', 'blue');
plot(movmean(y(:),20),'r-','linewidth',1);
I tried something like the following unfortunately without success. I would appreciate any help.
list=unique(p)';list(1)=[];
f=double(r.img).*repmat(p==i,[1,1,1,size(image,4)]);
y=sum(sum(nansum(f,1),2),3);y=y/sum(sum(sum(p==i)));
plot(y(:),'x-','color', 'blue');
plot(movmean(y(:),20),'r-','linewidth',1);
z = y(i) + y(i+1) + y(i+2)