• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

VincentToups/matlab-utils: Years of matlab utilities, including an interface bet ...

原作者: [db:作者] 来自: 网络 收藏 邀请

开源软件名称(OpenSource Name):

VincentToups/matlab-utils

开源软件地址(OpenSource Url):

https://github.com/VincentToups/matlab-utils

开源编程语言(OpenSource Language):

C 64.5%

开源软件介绍(OpenSource Introduction):

Matlab Utilities

Created after many years of graduate school in computational neuroscience, and covering a wide range of tasks from data analysis, to figure preparation with a large amount of system-connecting in between.

I am mostly adding putting this up for the sake of the Mathoc subfolder, which contains a relatively complete and functional bridge between matlab and the NEURON simulation environment. Rather than explain lugubriously, an example may instead be more illustrative of how it works and what it does:

init_hoc;
tstop = 5;
hoc_variable(tstop);
dt = .0125;
hoc_variable(dt);


call('load_file', "utilities.hoc");
call('load_file', "savers.hoc");
hoc('create soma');
neurons = {};
nNeurons = 50;
inhPerc = .2;

inhibitoryFlag = (1:nNeurons)<(nNeurons.*inhPerc);

for i=1:nNeurons
  neurons{i} = instantiate('IntFire4',.5)
end

connections = {};
for i=1:length(neurons)
  for j=1:length(neurons)
	if i~=j
	  if inhibitoryFlag(i)
		w = -.03;
	  else
		w = .01;
	  end
	  connections{i,j} = instantiate('NetCon',neurons{i},neurons{j},0,0,w);
	end
  end
end

for i=1:nNeurons
  stim = instantiate('NetStim');
  hoc_set(stim,'interval',1);
  hoc_set(stim,'number',1000);
  hoc_set(stim,'noise',1);

  netcon = instantiate('NetCon',stim,neurons{i},1,0,5);

end

for i=1:nNeurons
  recording1 = instantiate('VoltageTraceSaver',...
						  'a',...
						  -1,...
						  -1,...
						  code('utils.nil'),...
						  sprintf('/tmp/recording%d.data',i),neurons{i},'m');
end

simulation_loop(1);

for i=1:nNeurons
  delete(sprintf('/tmp/recording%d.data',i));
end

do_hoc(1);
data = [];
for i=1:nNeurons
  data = [data; load(sprintf('/tmp/recording%d.data',i))];
end
t = linspace(0,tstop,length(data));
close all
plot(t,data);

The above piece of code uses NEURON, via Matlab or Octave, to create a dead stupid model of a micro-column-like neural network. Fifty neurons are created, and around 20% are assigned inhibitory status. Then synaptic connections are created between all neurons depending on that status. Finally, excitatory input is created via a series of NetStim objects connected to each neuron, and objects for recording the voltages of the neurons are created. do_hoc initiates the simulation, and then the data from it is loaded and plotted.

Documentation is sparse right now, but the above example shows you how to do most everything you'd want to do. The system needs to know where your Neuron executable (nrniv) is located. You tell it by specifying the global variable hoc_exe_name__.

This whole system is based on Matlab compiling a hoc file describing the simulation, and then running it when do_hoc is called. You can check the file by looking at the global variable hoc__.

There is a lot of stuff going on behind the scenes with file names and so forth, and a lot of utilities on the hoc side to make things easier. I'll talk about them as I document them.

Finally, you can't use this package without having my whole matlab repository on the path somewhere (including sub-directories).




鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap