Today on the sixth day of MATLAB Training Program 2011, I have covered the loops. In MATLAB two types of loops (for loop and while loop) are used as we use in C/C++. The basic difference between for loop and while loop is that, in for loop the code repeated for a specified number of times and the number of repetitions are known before the loop start where as in while loop the code is repeated infinite number of times until some user specified condition is satisfied. The loops were explained with help of suitable examples: like factorial program, mean & standard deviation program etc.The functionality of loop can be increased by using conditional breaking statements. In MATLAB basically two conditional breaking statements( break andcontinue) are used. The break and continue statements also have a minute difference ,the breakstatement is used to terminate the loop on satisfying the given condition where as the continuestatement is used to terminate the current execution and send again the control at the starting of the loop.When we use control statements the chances of errors increases in the program so there is the need of debugger to debug the error. The MATLAB editor has inbuilt debugger, which works after setting break points in the program. The function key F10 is used to step in, in the program and function key F5 is used to switch on the next break point. To know more about MATLAB keep reading my blog.