solve the summation equation

2 Ansichten (letzte 30 Tage)
Abhijit Sardar
Abhijit Sardar am 4 Jan. 2021
Beantwortet: samuel okeleye am 18 Jan. 2021
can someone help me is solving the summation equation. upper row is the value of N and lower is value k for the given range
  1 Kommentar
Walter Roberson
Walter Roberson am 17 Jan. 2021
We cannot tell what Soi is, or what the relationship is between the summation and the table at the top of the diagram.
Once you have a vector of values you can use code such as
sum(So(K+1:end))

Melden Sie sich an, um zu kommentieren.

Antworten (1)

samuel okeleye
samuel okeleye am 18 Jan. 2021
clc;
clear;
n=5;
k=0;
numerator=0;
denominator=0;
If N=5 and K=3
You also initialized the numerator and denominators above so that you can subsequently add numbers.
So=[1;2;3;4;5];
Assuming So contains numbers 1 through 5
for i=(k+1):n
numerator= numerator+(So(i));
end
The upper part of the equation is calculated above
for i=1:n
denominator= denominator+(So(i));
end
The lower part of the equation is calculated above
answer=(n/(n-k))*(numerator/denominator);
This is the final equation

Kategorien

Mehr zu Mathematics finden Sie in Help Center und File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by