How do I plot the number of peaks of each graph in the for loop?
1 回表示 (過去 30 日間)
古いコメントを表示
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
0 件のコメント
回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Neural Simulation についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!