guchcha chor
Replies to this thread:

More by guchcha chor
What people are reading
Subscribers
Subscribers
[Total Subscribers 1]

sigh
:: Subscribe
Back to: Computer/IT Refresh page to view new replies
 Terribly in Need, Matlab...
Keywords associated with this thread

Matlab Infinite Sum Help
[VIEWED 11654 TIMES]
SAVE! for ease of future access.
Posted on 01-27-10 8:58 PM     Reply [Subscribe]
Login in to Rate this Post:     0       ?    
 

Hello MatLab /C++ gurus out there,
I tried to do it.. I couldn't. Please help me....

 
Posted on 01-28-10 12:15 AM     Reply [Subscribe]
Login in to Rate this Post:     0       ?    
 

Its in no way complete and hasn't been verified but should be enough of a pointer to get you in the right track if using Matlab:

clear
clc
N = 2;
e = 100;
e1 = 10^-5;
piii(1)= 1/0.75;
while e >= e1
pii=0;
for k=1:N
piii1= ((-1)^(k+1))/(0.5*k-0.25);
pii=piii1+pii;
end
piii(N)=pii;
e=abs(piii(N)-piii(N-1))/piii(N-1);
N=N+1;
end

On a second note you could tell the Prof., " I can use pi function of Matlab to get the damn number, why worry about doing the homework"

 
Posted on 01-28-10 1:29 AM     Reply [Subscribe]
Login in to Rate this Post:     0       ?    
 

Here is the code. It is perfectly running and does converge to 3.1416 for e=10^-8 with N= 63661979. Do the same for 10^-1 thru 10^-8. Hope you know how to make plots after this. Make sure the name of mat-file is pii.m and enjoy!!!!

function pii


clc


N=2;


pii=((-1)^2)/(0.5*1-0.25);


e=1;


 


while e>=10^-8;


    pii_old=pii;


    k=N;


    pii1= ((-1)^(k+1))/(0.5*k-0.25);


    N=N+1;


    pii=pii_old+pii1;


    e=abs(pii-pii_old)/pii_old;


end


pii_old


pii


N


e



 
Posted on 01-28-10 12:03 PM     Reply [Subscribe]
Login in to Rate this Post:     0       ?    
 

Thank you very much F22 and Santosh1984. I was dying to get the right answer...
Thank you

 


Please Log in! to be able to reply! If you don't have a login, please register here.

YOU CAN ALSO



IN ORDER TO POST!




Within last 90 days
Recommended Popular Threads Controvertial Threads
Democrat wants to run election like in India. Chaos and Confusing to voters.
рдП рез рдкрдирд┐ рдкреБрдЧреЗрдирдЫ ?
Breaking News: Ninth Circuit Rejects Government Bid to Undo Nepal TPS Order, Leaves Protections in Place
200 denaturalization cases per month to the Department of Justice for the 2026 fiscal year.
рдиреЛрдмреЗрд▓ рд╢рд╛рдиреНрддрд┐ рдкреБрд░рд╕реНрдХрд╛рд░ рд░ рдЕрд╢рд╛рдиреНрдд рд░рд╛рд╖реНрдЯреНрд░рдкрддрд┐рдХреЛ рдмрд╛рд▓рд╣рда
Funny when Nepalis talk about Epstein and injustice
рдорд┐рд░реЛ рдкреНрд░реЗрдбрд┐рдХреНрд╢рди рдЬрдиреНрдореЗрд░ рдПрдореЗрд░рд┐рдХрд╛рдорд╛ рдЖрдЦрд╛ рдЦреЛ рд▓ рди рдкрд╛рдпреЗрдХрд╛ рдирд╛рдЧрд░рд┐рдХрддрд╛ рдмрд╛рд░реЗ
рдиреЗрдкрд╛рд▓реА рд╡рд╛рд▓рдорд╛рд░реНрдЯ рдЪреЛрд░
H1B
рдорд╛рдирд╕рд┐рдХ рд╕рдиреНрддреБрд▓рди, рдПрдХ рдХрд╣рд╛рд▓реАрд▓рд╛рдЧреНрджреЛ рдШрдЯрдирд╛ рд╕рд┐рдХреНрдиреБрдкрд░реНрдиреЗ рдХреБрд░рд╛рд╣рд░реБ
When will Nepali women be equal?
Why Prachanda seems to be the smartest of them all?
When will the culture of impunity end?
рдмрд╛рд▓реЗрдВрди рдЖрдП рдкрдЫрд┐ рдЖрд╢рд╛рдХрд╛ рдХрд┐рд░рдг рджреЗрдЦрд┐рди рдерд╛рд▓реЗрдХрд╛ рдЫрдиреН !!
Can we really get rid of Nepotism in the government?
рдиреЗрдкрд╛рд▓реА рд╕рд╕реБрд░реЛрд▓реЗ рд╡рд░реНрдЬреАрдирд┐рдпрд╛рдорд╛рдБ рдЖрдлрд╝рдиреЛ рдЫреЛрд░реА рдирд╛рддреА рд░ рдЬреНрд╡рд╛рдИрд▓рд╛рдИ рдЦреБрдХреБрд░реА рдкреНрд░рд╣рд╛рд░
рдмрд╛рд▓реЗрдВрди рдореЗрдпрд░ рдмрд╛рдЯ рдкреНрд░рдзрд╛рди рдордиреНрддреНрд░рд┐ рд╣реБрдиреЗ рднреЛ ?
рдЖрд░рдХреЛ рдиреЗрдкрд╛рд▓реАрд▓реЗ рдмреЗрдЬрдд рдЧрд░реНрдпреЛ рдлреЗрд░реА рдЕрд░рд╡рд┐рдВрдЧ рдЯреЗрдХреНрд╕рд╛рд╕рдорд╛ рдмреБрдврд╝рд╛рд╣рд░реВ рд▓рд╛рдИ рд╕реНрдХреЙрдо рдЧрд░реЗрд░
Sukulgunda 2.0 / www.sukulgunda.com
How many ministries do we really need?
NOTE: The opinions here represent the opinions of the individual posters, and not of Sajha.com. It is not possible for sajha.com to monitor all the postings, since sajha.com merely seeks to provide a cyber location for discussing ideas and concerns related to Nepal and the Nepalis. Please send an email to admin@sajha.com using a valid email address if you want any posting to be considered for deletion. Your request will be handled on a one to one basis. Sajha.com is a service please don't abuse it. - Thanks.

Sajha.com Privacy Policy

Like us in Facebook!

↑ Back to Top
free counters