Compute the following using elementwise operations on a vector:
조회 수: 1 (최근 30일)
이전 댓글 표시
X= (1/2^0)+(1/2^1)+(1/2^2)+...(1/2^100)
댓글 수: 4
Steven Lord
2021년 9월 23일
Since you're relatively new to MATLAB, I suggest you start with the free MATLAB Onramp tutorial (https://www.mathworks.com/support/learn-with-matlab-tutorials.html) to quickly learn the essentials of MATLAB. It's supposed to take about two hours and should teach you the basic skills you should need for your assignments. Sections 4 through 6 seem most applicable to this assignment you've posted.
답변 (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.
참고 항목
카테고리
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!