MATLAB: Sum of an arrays elements

MATLABmatrix arrays

I have an assigntment which sounds like this:
square each element in C and determine the sum of all C's elements
How do i do this? I don't get the right result, that i am supposed to get.

Best Answer

I'd assume
C = [1 2 3];
res = sum(C.^2)
What is the input, what is the expected result?