How can I write an SDE in Matlab? My professor would like me to solve a system similar to the following:
 $$ dx_i=[f_i(x_1,x_2,...x_n)]dt + g_ix_idW_i$$
Where $g_i$ are positive constants that measure the amplitude of the random perturbations, and $W_i$ are random variables normally distributed.
Im not sure how I can implement this in Matlab for ode45 to solve.  What is throwing me off is the $dt$ tacked on to $f_i(x_1,...)$ and $dW_i$.  
Is it as simple as coding 
    function dxdt=money(t,x,a,b,c)

x1=x(1);
x2=x(2);
x3=x(3);

dx1=x1.*(x2-a)+x3 + 10*rand();
dx2=1-b*x2-x1.^2 + 10*rand;
dx3=-x1-c*x3 +10*rand();

dxdt=[dx1;dx2;dx3];

end


Unfortunately, I don't think you can use ode45 to solve it, whereas, since $dW$ distributes like $N(0,\sqrt{dt})$ you must use the following discretisation:
$$
x_{n+1,i}=x_{n,i}+f_i(x_{n,i})\Delta t+g_i(x_{n,i})x_{n,i}\sqrt{\Delta t}\cdot\epsilon_i,
$$
$$
\epsilon_i=\mbox{randn()}
$$
$$
x_{n,i}\approx x_i(t)
$$
