how to get refractory period in neuron of long vector 1*1500000 as [0 1]?
5 views (last 30 days)
Show older comments
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 Comments
Answers (1)
See Also
Categories
Find more on Neural Simulation in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!