summation of equation in matlab
1 vue (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Niharika Nayak
le 27 Jan 2020
Commenté : Wisal Adnan
le 18 Août 2020
I have an equation
S(i)*(P-C(i))
I want to perform summation operation such that
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/268413/image.png)
where n can be n=2 ,3 ,4....
please tell me what will be the approached???
Réponse acceptée
Walter Roberson
le 27 Jan 2020
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 commentaire
Wisal Adnan
le 18 Août 2020
I want to perform summation operation such that
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/347721/image.png)
where n can be n=2 ,3 ,4.... where i start from 1 to 2n
please tell me what will solution?
Plus de réponses (0)
Voir également
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!