MATLAB - Please Help!!!!!!!!!!!

edited October 2008 in Science & Tech
Define

>> a=1:12

How many times do each of the following loops execute?

for i=a
i.^2
end


for i=a'
i.^2
end

Would you please explain the steps?

Comments

  • shwaipshwaip bluffin' with my muffin Icrontian
    edited October 2008
    ...

    run it?
  • edited October 2008
    shwaip wrote:
    run it?

    Agreed... add a line to display what iteration you're on, and run it.

    Thinking like this is fundamental to learning a language. Test and observe (adding extra lines to allow you to see what's happening, if necessary).
Sign In or Register to comment.