Question: How to fix error?

in this code count.mw the error is about the dsolve between do and end do  but the dsolve actually works and can give me the value I want if there is no cycle outside like this count......mw , there is no big difference between two code about the dsolve funtion except the one in cycle is writen together not in several lines, why it happens and how to fix it?

Please Wait...