how to get refractory period in neuron of long vector 1*1500000 as [0 1]?

5 views (last 30 days)
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
arunkumar Mohanraj
arunkumar Mohanraj on 28 Mar 2016
refractory period- neuron never fire continuously. but in my long vector I'm getting sometimes continuous response of the neuron. so I want every fifth elements should be consider. because neurons never been in saturation level for long million seconds.

Sign in to comment.

Answers (1)

Azzi Abdelmalek
Azzi Abdelmalek on 28 Mar 2016
v=[0 0 0 1 1 1 0 0 1 0 1 0 1 1]
idx=v(5:5:end)
  1 Comment
arunkumar Mohanraj
arunkumar Mohanraj on 28 Mar 2016
Edited: Walter Roberson on 28 Mar 2016
thank you for your effort, but I am not looking just to extract the value. my vector length is shrinks with your idea. I following idea is works. i want to learn different idea rather than true or false statement
i=1;
position=[];
while i <= length(true_false)
if true_false(i)==1
positions=[positions i];
i=i+5;
else
i=i+1;
end
end

Sign in to comment.

Categories

Find more on Neural Simulation in Help Center and File Exchange

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!