Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
Calling R from MATLAB

Subject: Calling R from MATLAB

From: mahsa

Date: 1 Feb, 2013 00:10:18

Message: 1 of 1

I want to call an R package (poibin) in Matlab

In R to use this package I write
>install.packages('poibin', repos='http://cran.us.r-project.org')
>library(poibin)
>kk=0:10
>pp=c(.1,.2,.3,.4,.5)
>ppoibin(kk=kk, pp=pp, method = "DFT-CF",wts=NULL)

and it returns
[1] 0.1512 0.5226 0.8500 0.9774 0.9988 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000


Now I want to call this R function in matlab: give the inputs (i.e. kk and pp) and get the result.

I tried to use the following but I do not know how to pass inputs (i.e. kk and pp) and how to see the result
system('R CMD BATCH ppoibin(kk=kk, pp=pp, method = "DFT-CF",wts=NULL)')

Tags for this Thread

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us