Question: if statement inside a do-loop

How can I use an if statement inside a do - loop in maple and then plot a figure based on the conditional results? I need help with the correct syntax for combining the do-loop, `if` condition, and plotting command.

Sheet attached below:
Algorithmm.mw

Please Wait...