How to convert R code in Matlab

26 Ansichten (letzte 30 Tage)
Ricardo Duarte
Ricardo Duarte am 17 Jun. 2022
Beantwortet: Rik am 17 Jun. 2022
Dear all,
I have a extense R code which I would like to convert it to Matlab.
Is there any way to do this, a sort of automatic way? I no, how can I know the corresponding functions in matlab.
Thank you in advance.

Antworten (1)

Rik
Rik am 17 Jun. 2022
Unfortunately, no. It is not possible to convert R code automagically to Matlab code.
What you can do is call the R code from Matlab (e.g. using a file for data sharing and calling R through the system command). There is something available on the FEX (MATLAB R-link), but it is fairly old and seems to only work on Windows.
Otherwise you will have to replicate the functionality of the R function. Not every function has a 1-to-1 equivalent, which makes sense as R and Matlab are different languages. The languages are similar, so going line by line isn't a bad first step.

Kategorien

Mehr zu MATLAB finden Sie in Help Center und File Exchange

Produkte

Community Treasure Hunt

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

Start Hunting!

Translated by