Matlab - For Loop                                                      Home : www.sharetechnote.com

 

 

 

Format

 

    For var = startVal:endVal

         body; // do what you need to do

    end;

 

Examples

 

Ex 1 >

    s = 0;

    for i = 1:10

      s = s + i;

    end;