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!