Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
small-world-network

Subject: small-world-network

From: Nhl

Date: 17 Dec, 2013 08:38:08

Message: 1 of 2

I have a matlab program about small-world network. My neuron model is Fitz-Hugh Naguma and electrical coupling (three coupled neuron) I want to apply small-world network to this neuron model. my matlab programme is:
Can you help me what is wrong with it?
%FHN Modeli_VR_Q_e_small-world_networks
clc;clf;clear;
deltat=0.01;
t=250;
j=0;
N=3;
con_mat=ones(N,N)-eye(N); %all-to-all network
for B=0.0:0.001:0.04
    B
a=1.01;
j=j+1;
e=0.01;
A=0.01;
ohm=5;
w=0.1;
x=-0.8*ones(1,3);
y=-0.2*ones(1,3);
Isyn=zeros(1,3);
gsyn=0.1;
Qsin=0;
Qcos=0;
 
%SMALL-WORLD NETWORK
n=50;%number of nodes
k=4;%the nearest neighbor
p=0.5;%coupling probability
r=zeros(1,n);r(2:k+1)=1;r(n-k+1:n)=1;
C=toeplitz(r)
%subplot(2,2,1), spy(C)
%subplot(2,2,2)
v=find(rand(n,1)< p);
Cshort=sparse(v,ceil(n*rand(size(v))),ones(size(v)),n,n)

for i=1:t/deltat
    x=x+deltat.*(x - x.^3/3 -y -Isyn)./e;
    y=y+deltat.*(x +a +A.*cos(w*i*deltat) +B*cos(ohm*i*deltat) );

    I_syn = ( gsyn.* ( sum((Cshort)'.*con_mat,2).*x' - con_mat*x' ) )';
    
    Qv=x;
    Qv(find(Qv<0))=-1;
    
    Qvav=(1/n)*sum(Qv);
    Qsin=Qsin+2*Qav(2)*sin(w*i*deltat);
    Qcos=Qcos+2*Qav(2)*cos(w*i*deltat);
end
Qsin=Qsin/(t/deltat);
Qcos=Qcos/(t/deltat);
Qson(j)=sqrt(Qsin^2+Qcos^2);
end
Bplot=0.0:0.001:0.04;
plot(Bplot,Qson,'-o'),
grid on;
xlabel('B');
ylabel('Q');

Subject: small-world-network

From: Salvatore

Date: 15 Nov, 2014 15:15:21

Message: 2 of 2

"Nhl" wrote in message <l8p2hg$fob$1@newscl01ah.mathworks.com>...
> I have a matlab program about small-world network. My neuron model is Fitz-Hugh Naguma and electrical coupling (three coupled neuron) I want to apply small-world network to this neuron model. my matlab programme is:

Nhl - Did you ever get a response to your question or find your error? I am interested in the problem you were working on. Thank you, SDM

Tags for this Thread

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us