Call R function in Matlab

조회 수: 25 (최근 30일)
MINA FA
MINA FA 2020년 4월 9일
답변: Amish Saxena 2022년 7월 6일
Hi guys, I want call R function in matlab, could help me and describe step by step?
  댓글 수: 2
KSSV
KSSV 2020년 4월 9일
I would suggest converting R to MATLAB.
jessupj
jessupj 2020년 4월 9일
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

댓글을 달려면 로그인하십시오.

답변 (1개)

Amish  Saxena
Amish Saxena 2022년 7월 6일
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)

카테고리

Help CenterFile Exchange에서 Get Started with MATLAB에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by