how to get refractory period in neuron of long vector 1*1500000 as [0 1]?
5 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
function [stim_order,elements,v]= myfunction()
x=randn(1,5000);%plot(x);
cut_off_freq=125;
SR=5000; %sampling rate
[A,B]=butter(4,cut_off_freq/(SR/2),'low');
filtered_signal=filtfilt(A,B,x);
rest(1:5000)=0;
x1=[rest,(filtered_signal*4)];
x2=[rest,(filtered_signal*6)];
x3=[rest,(filtered_signal*8)];
elements = {x1,x2,x3};
for i = 1:50;
%random_order(:,i)=elements(randperm(length(elements)));
random_order=randperm(length(elements));
%stim_order(:,i)=randperm(length(elements));
stim_order(i,:)=elements(random_order);
order(i,:)=random_order;
end
z=order(:)';%:-cell columns
y=cell2mat(stim_order');
v=reshape(y',1,numel(y));%v-stimulation parameter
%v=double(v);
plot(v);
a=1;%represents the saturation value
b=-2.5;%b-offset of the curve
c=0.35;%c-slope,
t=-(v+b)/c; %v-stimulation parameter
prob=a./(1+exp(t));%probability of response
plot(v,prob,'.');
xlabel('stimulation');ylabel('response');
ranvector=rand(1,1500000);
response_noresponse=(prob>ranvector);
plot(response_noresponse)
for example long vector contains [0 0 0 1 1 1 0 0 1 0 1 0 1 1] I want every after fifth element has to be consider even if its 0 or 1
please help me
2 Kommentare
Antworten (1)
Azzi Abdelmalek
am 28 Mär. 2016
v=[0 0 0 1 1 1 0 0 1 0 1 0 1 1]
idx=v(5:5:end)
1 Kommentar
arunkumar Mohanraj
am 28 Mär. 2016
Bearbeitet: Walter Roberson
am 28 Mär. 2016
Siehe auch
Kategorien
Mehr zu Neural Simulation finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!