How can I coding this function correctly?

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

hint: you get more accuracy if you add starting from 1/n instead of from 1/1

댓글을 달려면 로그인하십시오.

답변 (1개)

Ameer Hamza
Ameer Hamza 2020년 9월 26일

0 개 추천

Since this is a homework question so I won't be giving exact code, but you can read the documentation of the following functions.

카테고리

도움말 센터File Exchange에서 Get Started with MATLAB에 대해 자세히 알아보기

태그

질문:

2020년 9월 26일

댓글:

2020년 9월 26일

Community Treasure Hunt

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

Start Hunting!

Translated by