How to transform or use R code in Matlab

조회 수: 47 (최근 30일)
Boonanan Lechayakittikorn
Boonanan Lechayakittikorn 2018년 2월 12일
답변: Suryaansh Mata 2019년 6월 18일
Hello everyone !! I would like to know about i have R code but i want to use this R code in matlab. Do you have method or way to use or transform code R for use in matlab ? I attach file R code. Please help me.
  댓글 수: 18
Boonanan Lechayakittikorn
Boonanan Lechayakittikorn 2018년 2월 12일
Sorry,i change function in R and run in matlab and I got output error
<<
>>
per isakson
per isakson 2018년 2월 12일
편집: per isakson 2018년 2월 12일
  • Did you read the help text of RunRcode ? I guess not and propose that you do that.
function RunRcode(RscriptFileName,Rpath)
% This function calls R to run R script (.r file) under Matlab, and returns 'runR.log' in
% the same folder with the input R script file. This code only works in Windows [...]
  • RunRcode does not return any output arguments. Why did you add A= ?

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

답변 (1개)

Suryaansh Mata
Suryaansh Mata 2019년 6월 18일
TLDR: No, there is not inbuilt functionality to convert R code to MATLAB code
No, MATLAB and R are essentially two different programming languages and there does not exist any inbuilt utility in either MATLAB or R to convert the Coder from one to another.
There might exist any external utility or hard coded converter that does the job, one such utility can be found here which can be given a try https://www.mathworks.com/matlabcentral/fileexchange/5051-matlab-r-link
Note-: There exist inbuilt MATLAB products that can convert MATLAB code to C/C++ or static and dynamic libraries and executables. Search for MATLAB Coder or the 'codegen' command.

카테고리

Help CenterFile Exchange에서 Logical에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by