I would like to export a function from Mathematica to allow it to be accessed from R and/or Matlab.
Is there a way to do this?
As an example, suppose I want to export the following (albeit contrived) function, that could be hard to replicate in R:
f[x_Integer] := Prime[x]
The actual function is long-winded, and its details don't matter (I think, but let me know if you need these). Basically I want to avoid trying to code up something that took me ages in Mathematica, into R or Matlab.
The reason I want to do this is I am writing a class problem set, and I want students (using Matlab or R) to be able to call a function that I have created in Mathematica.