summation of equation in matlab

1 次查看(过去 30 天)
I have an equation
S(i)*(P-C(i))
I want to perform summation operation such that
where n can be n=2 ,3 ,4....
please tell me what will be the approached???

采纳的回答

Walter Roberson
Walter Roberson 2020-1-27
sum(S(1:n) .* (P - C(1:n)))
In the case where n is the same as the size of S and C then this can be simplified to
sum(S .* (P - C))
  1 个评论
Wisal Adnan
Wisal Adnan 2020-8-18
I want to perform summation operation such that
where n can be n=2 ,3 ,4.... where i start from 1 to 2n
please tell me what will solution?

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Mathematics 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by