Madhava approximation of pi
Mostrar comentarios más antiguos
I am trying to approximate the value of pi using the equation Madahava of Sangamagrama used.
The code that I have so far is:
function [ output_args ] = madhavapi(m)
%This function will takes N as input and returns an approximation for pi.
k=[0 1 2 3 4]
1./(-3).k
[1/(-3)^0/(-3)^1/(-3)^2;
1./(2.*k-1)
1./sum*12
end
I am not sure how to conclude this code. When I try to execute the above code, I do not get any answer.
3 comentarios
Marc
el 26 de Oct. de 2013
Wasn't Madahava Sangamagrama a wizard in The Lord of the Rings?
KayLynn
el 26 de Oct. de 2013
Walter Roberson
el 26 de Oct. de 2013
Editada: Walter Roberson
el 26 de Oct. de 2013
You did not assign anything to "output_args"
"sum" is a function, not a variable.
You do not use "m" anywhere in your function.
The expression
1./(-3).k
is not valid. There is no "." operator in MATLAB.
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre Image Category Classification en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!