Am a beginner , please help me to finish this task .
Already wrote some code but not getting.
What are you exactly trying to do?
Matrices have two dimensions, not one, otherwise you're using vertices instead.
Besides that, I don't think your DO-loop is working correctly, because X1 = inited to 1, not 3, as are i and j.