[R] MATLAB to R

DivineSAAM@aol.com DivineSAAM at aol.com
Fri Jan 30 22:04:52 CET 2004


Ladies and Gentlemen,

In MATLAB, I can write:

for J=1:M
Y(J+1)=Y(J)+ h * feval(f,T(J),Y(J));
...

In R, I can write above as:

for (J in 2:M)
{
 y = y + h * f(t,y)
...
}
----
In MATLAB, I can write:

for J=1:M
k1 = feval(f,T(J),Y(J));
k2 = feval(f,T(J+1),Y(J)+ h * k1

How do I write k2 in R?
k1 = f(t,y)
k2 = ?

Thanks,
/oal




More information about the R-help mailing list