Compute the following using elementwise operations on a vector:
1 ビュー (過去 30 日間)
表示 古いコメント
X= (1/2^0)+(1/2^1)+(1/2^2)+...(1/2^100)
回答 (1 件)
Shayan Sepahvand
2021 年 9 月 23 日
Hi,
X = 0;
for i = 1:100
X_t = 1/(2^(i-1));
X = X_t + X;
end
X
1 件のコメント
John D'Errico
2021 年 9 月 23 日
Please do not do what is an obvious request to do their homework. This does not help the student, who learns nothing more than that there is always someone willing to do their job for them.
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!