Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Call R scripts in Matlab

Tags:

r

matlab

Is it possible to call R scripts in a MATLAB program? How can I do that?

like image 454
David Avatar asked Jul 14 '11 14:07

David


1 Answers

You can use R in batch mode. If R is in your path, then you can call from MATLAB:

system('R CMD BATCH infile outfile');

will run the code in infile and place output in the outfile.

EDIT: You can also give it a try with another approach using a R package rscproxy and R(D)COM Server, described here.

like image 74
Grega Kešpret Avatar answered Sep 19 '22 03:09

Grega Kešpret