I have two arrays: one with data points ( b, averaged every n points from a longer array a) and another one with specific indexes ( idx) that I got from a previous classification function of these data points ( P).
Please check my code:
n = 24459;
a = data.streams.EMGP.data;
b = arrayfun(@(i) mean(a(i:i+n-1)),1:n:length(a)-n+1)';
P = str2double(PP);
for i = 1: length(P)
idx = [idx,i];
for j = 1: length(idx)
In array idx, I have the positions of all datapoints of b that are classified in category 1. I want to creat a new array, EMGP, with all these specific values from b with indexes stated in idx. Then, I want the average value of EMGP.
How can I do this? Something is wrong if my loop while creating EMGP.
Please help. Thank you all!