I want to run a R script from matlab.
I can run the R code perfectly from cmd using:
cd "C:\Program Files\R\R-3.1.3\bin\x64"
R CMD BATCH "C:\Users\name\Desktop\Code.R"
However in Matlab I am not sure how to run this two instructions. First, I noticed that I could use:
system('cd "C:\Program Files\R\R-3.1.3\bin\x64"')
to run a commnand line command. However I need to run two. And making:
system('cd "C:\Program Files\R\R-3.1.3\bin\x64"')
system('R CMD BATCH "C:\Users\name\Desktop\Code.R"')
does not work.
I also saw this post about running multiple command line instructions in a single line, but also that did not work.
Anyone knows how to do it?