2 Answers

  1. Andrew- Reply


    Well, if I understand you correctly then:

    x = sum((1:10).^2);

    should do the trick.

  2. Andy- Reply


    You will first declare i as a vector containing the values over which you will sum.


    Then you simply sum the vector of the squares:

    ans =  385

Leave a Reply

Your email address will not be published. Required fields are marked *

You can use these HTML tags and attributes <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>