summation of 2 separate matrix
Show older comments
hi can anyone help me out with this problem i am having
x=[1 2 3 4 5];
y=[5 23 44 14];
i want to find the summation of x*y^2 so i am using loop function but my result come as 1
i=0;
for i=i+1
i<5;
d=0;
c=sum(x(i)*y(i)^2);
d=d+c;
end
>> d=.
can anyone please correct me where i am making mistake
thank you
Accepted Answer
More Answers (0)
Categories
Find more on Resizing and Reshaping Matrices in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!