Call R function in Matlab

7 visualizaciones (últimos 30 días)
MINA FA
MINA FA el 9 de Abr. de 2020
Respondida: Amish Saxena el 6 de Jul. de 2022
Hi guys, I want call R function in matlab, could help me and describe step by step?
  2 comentarios
KSSV
KSSV el 9 de Abr. de 2020
I would suggest converting R to MATLAB.
jessupj
jessupj el 9 de Abr. de 2020
not the same thing as implementing directly, but I have done the following in the past:
% SOME MATLAB that writes a csv
!Rscript r_script.R # use '!' to call the system R to run an R script
% for the function, write resutls to `Rout.csv'
% Some more MATLAB, starting with reading 'Rout.csv'
definitely not the best way, but it's a workaround

Iniciar sesión para comentar.

Respuestas (1)

Amish  Saxena
Amish Saxena el 6 de Jul. de 2022
Hi Mina ,
You can try the following :
  1. The required functionality can be found in here. You can try using this.
  2. You can also use the "system" command as well, this lets you execute commands from the OS in MATLAB. To learn more about that this, see its doc page here.
  3. In the end there is always try : Calling R from Matlab – flat file communication – xcorr: comp neuro (this is similar to @jessupj's comment and a kind of hack)

Categorías

Más información sobre Get Started with MATLAB en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by