function esn = create_esn(nResUnits, nOutputs, connectivity, srScaling)

%%%% set the number of units
    %esn.nInputs = nInputs; 
esn.nResUnits = nResUnits; 
esn.nOutputs = nOutputs; 

nAllUnits = nResUnits + nOutputs;

esn.nAllUnits = nAllUnits;

%esn.resWeights = createReservoir(nResUnits, connectivity);
esn.resWeights = generate_internal_weights(nResUnits, connectivity / 100);

esn.resWeights = esn.resWeights * srScaling;

%2.0 * rand(nResUnits, nInputs)- 1.0;


% output weight matrix has weights for output units in rows

esn.outWeights = 2 * rand(nOutputs, nResUnits) - 1;

%output feedback weight matrix
%esn.feedbackWeights = sprand(nResUnits, nOutputs, 0.150) - 0.5;
esn.feedbackWeights = 2 * rand(nResUnits, nOutputs) - 1;

esn.y = zeros(1, nOutputs)'; %2.0 * rand(1, nOutputs)' - 1;
esn.x = rand(1, nResUnits)' - 0.5;  %  %zeros(1, nResUnits)';



