Question: i want to know how to merge these two loops in one? how to apply if else loop?

Dear Friends

Do I want to know how to merge these two loops in one? how to apply if-else loop? help me in this regard. the source file is attached. Thank you! 

restart; M := 5;
for i1 while i1 <= M do N[i1, 0](u) = 1 end do;
                         N[1, 0](u) = 1
                         N[2, 0](u) = 1
                         N[3, 0](u) = 1
                         N[4, 0](u) = 1
                         N[5, 0](u) = 1
for k1 while k1 <= M do N[0, k1](u) = 0 end do;
                         N[0, 1](u) = 0
                         N[0, 2](u) = 0
                         N[0, 3](u) = 0
                         N[0, 4](u) = 0
                         N[0, 5](u) = 0

 

Please Wait...