how to calculate this equation in matlab?
3 ビュー (過去 30 日間)
古いコメントを表示
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1409764/image.png)
for i, n >3
can i calulate or generate any program for this equation.
6 件のコメント
採用された回答
Harsh Kumar
2023 年 6 月 15 日
編集済み: Harsh Kumar
2023 年 6 月 15 日
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
0 件のコメント
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Loops and Conditional Statements についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!