calculate summation of vectors
2 views (last 30 days)
William Rose on 17 Sep 2021
@Kha Le, This sounds a lot like a homework question. Hints:
Break it into two parts: the sum of the unsquared terms plus the sum of the squared terms.
Read help for linspace.
Read the Matlab help for element-wise power, .^, especially example 1.
Read the Matlab help for sum.
If you still don't know, then show what you have tried that did not work, and show if you got an error message, or you got an answer that you know is the wrong answer, etc.