How do I plot the number of peaks of each graph in the for loop?

1 visualización (últimos 30 días)
C Lob
C Lob el 29 de Nov. de 2017
Hello, The following code takes a step current, inputs it into a neuron which gives an output voltage, which is then converted to current and imputed into the next neuron. This is then repeated 20 times. I am trying to plot the number of voltage peaks over 0 in each of the 20 plots produced in the for loop and plot this number of peaks as a function of the neuron number(figure number). However, I keep getting the peaks for the final plot only, instead of the number of peaks for each plot vs its neuron number.
% code
for neuronnumber=1:1:20
AV=AbsValue(v);
I=Current(AV);
[v,n,m,h]=HHmodel(ts,I);
figure
plot(ts,v)
xlabel('Time (s)');
ylabel('Output Voltage (mV)');
title('Output Voltage vs Time (HH model)');
spike=numel(findpeaks(v,'MinPeakHeight',0))
end
figure
plot(neronnumber,spike)
xlabel('Neuron Number')
ylabel('Number of Spikes')
title('Number of spikes vs Neuron Number')
I'm not quite sure what I am doing wrong and any help would be appreciated. thanks

Respuestas (0)

Categorías

Más información sobre Neural Simulation en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by