for i, n >3
can i calulate or generate any program for this equation.

6 commentaires

VM Sreeram
VM Sreeram le 13 Juin 2023
Seems to be a homework question. Read this answer to know more.
John D'Errico
John D'Errico le 13 Juin 2023
Modifié(e) : John D'Errico le 13 Juin 2023
Sure. you CAN calculate it. You could start with the known sum of a geometric series, for the internal sum on the powers of 2.
And then you could use a simple loop to compute that product. Or, you could create a vector of elements, and then use prod.
But, since this is probably homework, and you have made no attempt at all, you should start writing. Make an effort, and you would get more help. Make no effort at all, and we tell you to learn MATLAB, and to make an effort.
Torsten
Torsten le 13 Juin 2023
Since the upper limit of the product is 3 and i is assumed to be greater than 3, the product is empty. By convention, its value is 1. Thus the result of your expression is n*(n-1)*(n-2)*1/2.
Kajal Agrawal
Kajal Agrawal le 14 Juin 2023
ok, i have tried with loop but doesn't work properly.
Dyuman Joshi
Dyuman Joshi le 14 Juin 2023
Please show what you have attempted.
Kajal Agrawal
Kajal Agrawal le 14 Juin 2023
I think i have mistaken in loop..

Connectez-vous pour commenter.

 Réponse acceptée

Harsh Kumar
Harsh Kumar le 15 Juin 2023
Modifié(e) : Harsh Kumar le 15 Juin 2023
Hi Kajal ,
It is my understanding that you are interested in generating a program for the above mentioned mathematical equation.
You can use the concept of 'Nested Loop' to iterate over the two variables i.e, r and j for addition and multiplication respectively.
Please refer to the below code snippet for better understanding.
clc
clear
n=input('enter the value of n=')
i=input('enter the value of i=')
%variable to store product of terms
p=1;
for j=i:3
s=0; %sum variable
for r=1:j-2
s=s+(2^(j-2-r));
p=prod(p,2^(j-2)*(n)-(2^(j-1)-s));
end
end
vertices=(n*(n-1)*(n-2)*p)/2;
disp('vertices')
vertices

Plus de réponses (0)

Catégories

En savoir plus sur Loops and Conditional Statements dans Centre d'aide et File Exchange

Produits

Version

R2013a

Community Treasure Hunt

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

Start Hunting!

Translated by