Filter löschen
Filter löschen

Calling R from MATLAB on a Mac

6 Ansichten (letzte 30 Tage)
the cyclist
the cyclist am 20 Jan. 2011
Is there a canonical method for calling R from MATLAB, on a Mac?

Akzeptierte Antwort

Manu R
Manu R am 20 Jan. 2011
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.
  2 Kommentare
the cyclist
the cyclist am 21 Jan. 2011
Thanks. I'll try this. Hopefully it works as well as your git script, which I recently started using!
the cyclist
the cyclist am 25 Jan. 2011
Thanks. Worked great.

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (1)

Doug Hull
Doug Hull am 20 Jan. 2011
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.
  1 Kommentar
the cyclist
the cyclist am 20 Jan. 2011
Thanks for the reply, Doug, but that looks like a Windows-only solution.

Melden Sie sich an, um zu kommentieren.

Kategorien

Mehr zu Startup and Shutdown finden Sie in Help Center und File Exchange

Tags

Produkte

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by