Info
この質問は閉じられています。 編集または回答するには再度開いてください。
create function that performs the following computation
1 回表示 (過去 30 日間)
古いコメントを表示
S=N = 1+1/2+1/3+1/4+.........1/N
Σ
K =1
1 件のコメント
回答 (1 件)
KALYAN ACHARJYA
2018 年 10 月 3 日
function sum_result=sum1(n)
sum1=0;
for i=1:n
sum1=sum1+1/n;
end
end
Same can be done by using while loop also. It someone using indexing, it would be better.\
Learn Matlab by doing
0 件のコメント
この質問は閉じられています。
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!