I've managed to find the solution on my own, needed to change up the initial values to non zero and fix up a few kinks in the code based on an article I had.
for those interested the final code is as follows:
rand('state',100)
r = 2; K = 1; Xzero = 0.5; % problem parameters
T = 1; N = 500; dt = T/N;
beta = 0.25;
dW = sqrt(dt)*randn(N,N); % Brownian increments
Xmil = zeros(N,1); % preallocate array
Xtemp = Xzero*ones(N,1);
for j = 1:N
Winc = sum(dW(:,j),2);
Xtemp = Xtemp + dt*r*Xtemp.*(K-Xtemp) + beta*Xtemp.*Winc + 0.5*beta^2*Xtemp.*(Winc.^2 - dt);
end
Xmil = Xtemp;
Dt = zeros(N,1); %building an array for the time values we have taken
for j = 2:N
Dt(j) = j*dt;
end
plot(Dt,Xmil)
title('Solution of The Milstein')
xlabel('t');ylabel('X(t)');