Help with Homework Question

Hi, I am really stuck on this question and have no idea how to do it. Can someone please help..
Formula for true relative error is (pi- Calculated pi)/pi

댓글 수: 1

Amit
Amit 2014년 1월 30일
Again, A homework problem need to be done by you. First it's unethical for someone else to do your homework.
Post your effort or idea on how to solve it, then others will help you.

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

답변 (1개)

Moussa Attati
Moussa Attati 2022년 10월 21일

0 개 추천

function [PI,RelativeErr] = pi_func(n)
P=0;
for i = 1 : n
PI =4*(((-1)^(i-1))*1/(2*i-1))+P ;
P = PI;
end
RelativeErr=1-(PI/pi) ;
end

카테고리

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

질문:

2014년 1월 30일

답변:

2022년 10월 21일

Community Treasure Hunt

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

Start Hunting!

Translated by