A couple different things can fix this, but I would suggest this one just creating the variable a again after your for loop ->
for a = 6838:1:l
...
end
a = 6838:1:l;
Also, after doing this if the plot looks weird to you still, I would suggest switching a and d_omega_drei in your plotting.