There are some mistakes and unclear parts in your code. However, using your code, you can save it as;
Pload = linspace (1,2,4)
for i= 1:10
Unclear part: why are you calling "randperm" function with "length(Pload)" why are you calling "for i = eye(10)"