I have own function wrote. I used an algorithm, which was written in Matlab. in matlab: ... gamma = inv(v)*g; ... #v = matrix of variable size, v=vv(k) => k=2 => dimension of v 2x2 #g = a line vector with 4 elements e.g. g=[1,0,2,0]; my rewritten r-file: ... gamma = solve(v)*g; ... which is my error? Who can help me? thank you in advance. Chris -- Lust, ein paar Euro nebenbei zu verdienen? Ohne Kosten, ohne Risiko! Satte Provisionen f??r GMX Partner: http://www.gmx.net/de/go/partner --
Please provide an example that doesn't work, I made one up quickly just to see what would happend and it worked without errors. > g=c(1,0,2,0)> g[1] 1 0 2 0> v<-c(5,10,15,20) > dim(v) <- c(2,2) > v[,1] [,2] [1,] 5 15 [2,] 10 20> solve(v)*g[,1] [,2] [1,] -0.4 0.6 [2,] 0.0 0.0 On 8/30/05, Christian Hinz <Chris.Planet@gmx.de> wrote:> > I have own function wrote. I used an algorithm, which was written in > Matlab. > > in matlab: > ... > gamma = inv(v)*g; > ... > > #v = matrix of variable size, v=vv(k) => k=2 => dimension of v 2x2 > #g = a line vector with 4 elements e.g. g=[1,0,2,0]; > > my rewritten r-file: > ... > gamma = solve(v)*g; > ... > > which is my error? Who can help me? > > thank you in advance. > > Chris > > > -- > Lust, ein paar Euro nebenbei zu verdienen? Ohne Kosten, ohne Risiko! > Satte Provisionen für GMX Partner: http://www.gmx.net/de/go/partner > > -- > > ______________________________________________ > R-help@stat.math.ethz.ch mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide! > http://www.R-project.org/posting-guide.html >[[alternative HTML version deleted]]
Christian Hinz wrote:> I have own function wrote. I used an algorithm, which was written in Matlab. > > in matlab: > ... > gamma = inv(v)*g; > ... > > #v = matrix of variable size, v=vv(k) => k=2 => dimension of v 2x2 > #g = a line vector with 4 elements e.g. g=[1,0,2,0]; > > my rewritten r-file: > ... > gamma = solve(v)*g; > ... > > which is my error? Who can help me?Ehhh, don't know what Matlab does with the code given above. In R: If v is 2x2 and g has length 4, this seems to be strange, but the matrix is treated as a vector for the multiplication step and there should not be an error message (but probably not the result you want to get) ... Uwe Ligges> thank you in advance. > > Chris > >
A quick reply, are you looking for the matrix multiplication operator? In R it's %*% Henrik Christian Hinz wrote:> I have own function wrote. I used an algorithm, which was written in Matlab. > > in matlab: > ... > gamma = inv(v)*g; > ... > > #v = matrix of variable size, v=vv(k) => k=2 => dimension of v 2x2 > #g = a line vector with 4 elements e.g. g=[1,0,2,0]; > > my rewritten r-file: > ... > gamma = solve(v)*g; > ... > > which is my error? Who can help me? > > thank you in advance. > > Chris > >
I need the LU_Decomposition for my conversion of the DIRK/SDIRK (singly diagonally Runge Kutta implicit methods) algorithm. thank you in advance. Christian Hinz -- --
On Wed, 9 Nov 2005, Christian Hinz wrote:> I need the LU_Decomposition for my conversion of the DIRK/SDIRK (singly > diagonally Runge Kutta implicit methods) algorithm.I think you need the Matrix package: http://cran.r-project.org/src/contrib/Descriptions/Matrix.html Mike
Christian Hinz
2006-Jan-24 11:01 UTC
[R] Is there no definition for global variables in R?
Hello @all R-Help-User. I need a global variable in R. The variable ought to be known for every functions and subfunctions. It is only to comparison purposes of the numeric algorithms. Is there a possibility? please answer in german if possible. thank you in advance. Christian Hinz -- ********************* Christian Hinz Wickrather Str. 230 41236 M??nchengladbach 02166/125369
Hello @all R-Help-User. I need urgently your assistance!!! I need a global variable in R. The variable ought to be known for every functions and subfunctions. It is only to comparison purposes of the numeric algorithms. Is there a possibility? please answer in german if possible. thank you in advance. Christian Hinz -- ********************* Christian Hinz Wickrather Str. 230 41236 M??nchengladbach 02166/125369 ********************* -- ********************* Christian Hinz Wickrather Str. 230 41236 M??nchengladbach 02166/125369
On 1/24/06 8:15 AM, "Christian Hinz" <Chris.Planet at gmx.de> wrote:> Hello @all R-Help-User. > > I need urgently your assistance!!! > I need a global variable in R. The variable ought to be known for every > functions and subfunctions. It is only to comparison purposes of the > numeric algorithms. Is there a possibility? > > please answer in german if possible.a <- 1 is in your workspace, so it is "global" in the sense that it is accessible to functions. Be sure to read http://cran.r-project.org/doc/manuals/R-intro.html for more information.... Sean