Check out example codes for "for each loop matlab". It will help you in understanding the concepts better.

Code Example 1

elements = 6:2:12;

for element = elements
  % Do stuff with element
  disp(element);
end

Learn ReactJs, React Native from akashmittal.com