Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon.

Pages: 1-

Matlab

Name: Anonymous 2012-02-19 12:11

So i'm trying to do the method of Newton-raphson, all i can do is this but do not run, help a bro out please
:
function x3=nr(sem)
if (f(sem+h)-f(sem))/2h=0;
        display('la funcion no es diferenciable por lo tanto no es posible aplicar el metodo de newton-rhapson')
    return
end
%definir tolerancias
dtol=1e-4;
etol=1e-4;
Nmax=100;
h=10^-4;
%inicializacion de variables
sem=0;
eL2=1;
desv=1;
n=1;

while(eL2>etol)||(desv>dtol)&&(n<=Nmax)
    fp=(f(sem+h)-f(sem))/2h);
    x3=sem-(f(sem)/fp);
   
    %errores
    eL2=abs((x3-sem)/x3);
    desv=abs(f(x3));
    if n<Nmax
%         fprintf('n=%0.0f sem=%1.6f x3=%1.6f eL2=%1.3e\n',n,sem,x3,eL2,desv)
    n=n+1;
    sem=x3;
    x3=[x3,n,eL2,desv];
    end
end

Name: Anonymous 2012-02-19 12:24

You're not a bro if you do math in Spanish. Therefore we WON'T HELP YOU

Name: Anonymous 2012-02-19 12:37

"i'm so sorry i'm from latino-america"
i'm really not but you won't help just because English is not my maternal language? that is just stupid my friend and FYI math is universal, do not matter your language, stupid cunt

Name: Anonymous 2012-02-19 12:45

Matlab: Programming for engineers

Name: Anonymous 2012-02-19 12:50

>>3
Permit me to assist you in understanding: YHBT

Name: Anonymous 2012-02-19 13:10

>>4
Programming in Matlab makes me want to fart.

Name: Anonymous 2012-02-19 13:45

Matlab: Programming for queers.

Name: Anonymous 2012-02-19 16:20

if (f(sem+h)-f(sem))/2h=0;
Stopped reading after that.

MATLAB is not as bad as the idiots in this shithole think it is, but that code is bad.

Name: Anonymous 2012-02-20 10:38

>>8
yeah but why dude?

Name: Anonymous 2012-02-20 10:51

goddammit code tags use them pendejo de mierda

Name: Anonymous 2012-02-20 10:59

Learn D man. Makes this shit so much easier.

Name: Anonymous 2012-02-20 11:04

>>4

EE CompE here.  You're talking about those other engineering fields.

Don't change these.
Name: Email:
Entire Thread Thread List