Re: [R] R and MatLab implementations of the same model differs

2013-07-05 Thread Jannetta Steyn
Aah. Thanks. I remember someone mentioned a named vector and I meant to ask what that was, but I forgot. I have now fixed it. On 5 July 2013 17:18, Berend Hasselman wrote: > > On 05-07-2013, at 17:37, Jannetta Steyn wrote: > > > Thank you very much to all of you for your help. This model now

Re: [R] R and MatLab implementations of the same model differs

2013-07-05 Thread Berend Hasselman
On 05-07-2013, at 17:37, Jannetta Steyn wrote: > Thank you very much to all of you for your help. This model now works as it > should (I believe). This is the final code: > > rm(list=ls()) > > library(deSolve) > > ST <- function(time, init, parms) { > with(as.list(c(init, parms)),{ > >

Re: [R] R and MatLab implementations of the same model differs

2013-07-05 Thread Jannetta Steyn
Thank you very much to all of you for your help. This model now works as it should (I believe). This is the final code: rm(list=ls()) library(deSolve) ST <- function(time, init, parms) { with(as.list(c(init, parms)),{ #functions to calculate activation m and inactivation h of the current

Re: [R] R and MatLab implementations of the same model differs

2013-07-05 Thread Jannetta Steyn
On 5 July 2013 09:44, Berend Hasselman wrote: > > On 05-07-2013, at 09:53, Jannetta Steyn wrote: > > > > > > > > > > > I don't quite know how to explain the "doesn't work" in more detail > without > > > any visual aid. > > > > You said that R got into an indefinite loop, whatever that maybe. > >

Re: [R] R and MatLab implementations of the same model differs

2013-07-05 Thread Berend Hasselman
On 05-07-2013, at 09:53, Jannetta Steyn wrote: > > > > > > I don't quite know how to explain the "doesn't work" in more detail without > > any visual aid. > > You said that R got into an indefinite loop, whatever that maybe. > > > > When I change the solver to ode45 the script never stops r

Re: [R] R and MatLab implementations of the same model differs

2013-07-04 Thread peter dalgaard
On Jul 5, 2013, at 00:41 , Jannetta Steyn wrote: > Hi All > > Thanks for all the comments. I have looked at everything you have pointed > out and this is the situation at the moment: > >> I don't think so. >> In the R script you have >> >> init = c(v_axon_AB=-55,mNa_axon_AB=1,hNa_axon_AB=0,mK_

Re: [R] R and MatLab implementations of the same model differs

2013-07-04 Thread Jannetta Steyn
Hi All Thanks for all the comments. I have looked at everything you have pointed out and this is the situation at the moment: > I don't think so. > In the R script you have > > init = c(v_axon_AB=-55,mNa_axon_AB=1,hNa_axon_AB=0,mK_axon_AB=1) > > That is not the same as in your Matlab script. To m

Re: [R] R and MatLab implementations of the same model differs

2013-07-04 Thread peter dalgaard
On Jul 4, 2013, at 20:14 , Berend Hasselman wrote: > > On 04-07-2013, at 19:56, peter dalgaard wrote: > >> >> On Jul 4, 2013, at 19:11 , Berend Hasselman wrote: >> >>> >>> On 04-07-2013, at 18:42, Jannetta Steyn wrote: >>> Hi Ben and others I don't quite know how to explai

Re: [R] R and MatLab implementations of the same model differs

2013-07-04 Thread Berend Hasselman
On 04-07-2013, at 19:56, peter dalgaard wrote: > > On Jul 4, 2013, at 19:11 , Berend Hasselman wrote: > >> >> On 04-07-2013, at 18:42, Jannetta Steyn wrote: >> >>> Hi Ben and others >>> >>> I don't quite know how to explain the "doesn't work" in more detail without >>> any visual aid. >>

Re: [R] R and MatLab implementations of the same model differs

2013-07-04 Thread peter dalgaard
On Jul 4, 2013, at 19:11 , Berend Hasselman wrote: > > On 04-07-2013, at 18:42, Jannetta Steyn wrote: > >> Hi Ben and others >> >> I don't quite know how to explain the "doesn't work" in more detail without >> any visual aid. > > You said that R got into an indefinite loop, whatever that may

Re: [R] R and MatLab implementations of the same model differs

2013-07-04 Thread Berend Hasselman
On 04-07-2013, at 18:42, Jannetta Steyn wrote: > Hi Ben and others > > I don't quite know how to explain the "doesn't work" in more detail without > any visual aid. You said that R got into an indefinite loop, whatever that maybe. > When you run the two scripts it is easy to see the > differe

Re: [R] R and MatLab implementations of the same model differs

2013-07-04 Thread Jannetta Steyn
Hi Ben and others I don't quite know how to explain the "doesn't work" in more detail without any visual aid. When you run the two scripts it is easy to see the difference. MatLab produces a line on x= -55. This is what I expect - a more or less straight line. R on the other hand the result drops

Re: [R] R and MatLab implementations of the same model differs

2013-07-04 Thread Ben Bolker
Berend Hasselman xs4all.nl> writes: > > > On 04-07-2013, at 17:15, Jannetta Steyn henning.org> wrote: > > > Hi folks > > > > I have implemented a model of a neuron using Hodgkin Huxley equations in > > both R and MatLab. My preference is to work with R but R is not giving me > > the correct

Re: [R] R and MatLab implementations of the same model differs

2013-07-04 Thread Berend Hasselman
On 04-07-2013, at 17:15, Jannetta Steyn wrote: > Hi folks > > I have implemented a model of a neuron using Hodgkin Huxley equations in > both R and MatLab. My preference is to work with R but R is not giving me > the correct results. I also can't use ode45 as it just seems to go into an > indef

[R] R and MatLab implementations of the same model differs

2013-07-04 Thread Jannetta Steyn
Hi folks I have implemented a model of a neuron using Hodgkin Huxley equations in both R and MatLab. My preference is to work with R but R is not giving me the correct results. I also can't use ode45 as it just seems to go into an indefinite loop. However, the MatLab implementation work fine with

Re: [R] R and Matlab

2012-12-25 Thread Suzen, Mehmet
Simplest way is the call a system command, using R CMD. See :http://stackoverflow.com/questions/6695105/call-r-scripts-in-matlab But there are more complicated solutions are proposed: http://www.mathworks.co.uk/matlabcentral/fileexchange/5051 This is uses R-(D)-COM In my opinion most robust int

[R] R and Matlab

2012-12-24 Thread Amirehsan Ranginkaman
Hi, How can I call R functions or Package in MatLab? Is there any way? Thanks Regards Ranginkaman [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posti

Re: [R] R and Matlab

2010-10-29 Thread Henrik Bengtsson
Hi. On Fri, Oct 29, 2010 at 3:31 AM, Claudia Beleites wrote: > Dear Henrik, > > sorry for bothering you with a report hastily pasted together and not > particularly nice for you as I used my toy data flu from a non-standard > package. I should have better used e.g. the iris. > > I'm aware that wr

Re: [R] R and Matlab

2010-10-29 Thread Claudia Beleites
Dear Henrik, sorry for bothering you with a report hastily pasted together and not particularly nice for you as I used my toy data flu from a non-standard package. I should have better used e.g. the iris. I'm aware that writeMat doesn't deal with S4 objects. In fact, if I'd overlook the erro

Re: [R] R and Matlab

2010-10-28 Thread Henrik Bengtsson
Hi, thanks for reporting on a potential issue with writeMat() in R.matlab. However, I think you are blaming the wrong source here. There is basically nothing wrong with writeMat() and the MAT files written by it can indeed be read by Matlab. I think you are experiencing two different problems.

Re: [R] R and Matlab

2010-10-28 Thread Claudia Beleites
On 10/28/2010 03:16 PM, Thomas Levine wrote: Is there a particular reason you can't use csv? (Not sure whether I'm meant - as I also suggested csv to Santosh) But: - It used to work, so there may be code existing that is broken now (e.g. I do have such code, but at least for the moment it does

Re: [R] R and Matlab

2010-10-28 Thread Thomas Levine
Is there a particular reason you can't use csv? write.csv() in R It seems that you can read csv in Matlab with this http://www.mathworks.com/help/techdoc/ref/importdata.html Tom 2010/10/28 Claudia Beleites : >> I am looking for ways to use R and Matlab. Doing the data transformations >> in >> R

Re: [R] R and Matlab

2010-10-28 Thread Claudia Beleites
I am looking for ways to use R and Matlab. Doing the data transformations in R and using the data in Matlab to analyze with some pre-defined scripts. Any good ways to transfer the data into matlab in its most recent version? I tried using R.matlab but the writeMat output is not readable by Matlab.

[R] R and Matlab

2010-10-28 Thread Santosh Srinivas
Dear Group, I am looking for ways to use R and Matlab. Doing the data transformations in R and using the data in Matlab to analyze with some pre-defined scripts. Any good ways to transfer the data into matlab in its most recent version? I tried using R.matlab but the writeMat output is not readabl