Calling R from MATLAB on a Mac
5 次查看(过去 30 天)
显示 更早的评论
Is there a canonical method for calling R from MATLAB, on a Mac?
采纳的回答
Manu R
2011-1-20
I've used Rscript with the --vanilla flag successfully from the OS X command line in the past. To use in MATLAB, this is what I'd consider doing.
1. Prepend the following to the top of myscript.R, the program you want to run:
#! /usr/bin/Rscript
2. From the OS X shell, set the executable bit on your program if it hasn't been done:
$ chmod u+x myscript.R
3. Now, you're set up to use the system function in MATLAB:
>> system('~/path_to/myscript.R')
The usual caveats about paths apply.
更多回答(1 个)
Doug Hull
2011-1-20
The statistics language, R, is not supported in MATLAB; however, the following link contains MATLAB functions on MATLAB Central and File Exchange that may allow communication from MATLAB to R.
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Startup and Shutdown 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!