Solved
In your program you store all results in the very same variable c, one iteration overwriting the value of the previous one. You have to collect the results in a matrix. Furthermore you were missing any initialization of c. I guessed that it should be initialized in the inner loop.
Hope this is something you looking:

Welcome to the PTC Community
No account yet? Create an account
Please use your PTC eSupport account.
LoginEnter your E-mail address. We'll send you an e-mail with instructions to reset your password.

