MATLAB programming of Particle Filter - what is going wrong?
I have a few comments about things to fix.

1st your for j = 1:length(observationx) doesn't seem to have an end. My guess is you should have this just before the line norm_weight = weight/norm(weight);.

2nd your apriori_state, rms, and weight change size every iteration. This can cause matlab to run very slow. In order to improve this you need to preallocate the variable. This can be done like so: apriori_state = zeros(size(resultx_1));

As far as actual functionality I don't see anything that pops at as being wrong. The math and stats site linked to in a comment might be able to find functionality errors faster then I can.