How can I coding this function correctly?
5 ビュー (過去 30 日間)
古いコメントを表示
Write a function called Harmonic Sum.The input to this function is a single number, n. The function will return the value 1 + 1/2 + 1/3 + ... + 1/n.
1 件のコメント
Walter Roberson
2020 年 9 月 26 日
hint: you get more accuracy if you add starting from 1/n instead of from 1/1
回答 (1 件)
Ameer Hamza
2020 年 9 月 26 日
Since this is a homework question so I won't be giving exact code, but you can read the documentation of the following functions.
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Get Started with MATLAB についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!