clear all;clc;

index = [1:1000];
kndex = [5,6,7,8,9];
for k = 1:15
    data(k,:) = cos( k*0.1*pi*index );
end

%% coupling cos signals
%c = round( length(kndex)/2 );
c = length(kndex)-1;
data_coupling = zeros(1,length(index));
for i = 1:length(index)
    un = randperm( length(kndex) );  %生成 length(kndex) 的索引
    sndex = kndex( un(1:c) );                  %生成 kndex 的索引
    temp = data( sndex,i );
    data_coupling(i) = sum(temp);
end

coupling = data_coupling;
plot(coupling);
save CoupingCosine coupling;




