Rank: 363483 based on 0 downloads (last 30 days) and 0 file submitted
photo

Martin Heroux

E-mail
Company/University
University of British Columbia

Personal Profile:
Professional Interests:
Neuroscience Research

 

Watch this Author's files

 

Comments and Ratings by Martin
Updated File Comments Rating
13 Jun 2009 MATLAB R-link Functions for calling the statistical package R from within MATLAB. Author: Robert Henson

Overall, it seems like this will add a great deal of versatility to Matlab. Unfortunately, the documentation is very succinct and I am having difficulty getting even basic statistical tests to give me an output in Matlab.

% Running a simple K-S test to determine whether two samples have the same distribution
a = rand (100,1); % creating a random signal
i = pi/100 :pi/100: pi;
b = (sin (i))' + a; % creating second signal

% Putting both signals into R
putRdata('a',a);
putRdata('b',b);

% Running ks.test in R and retrieving the output
evalR ('output <- ks.test(x, y)')
getRdata ('output')

%%%%%

I can run this code in R and get the output from the statistical test. However, when I try to get the R data (getRdata), Matlab give me the following error message:

Error using ==> getRdata at 47 Could not get output.
Invoke Error, Dispatch Exception: There is no connection for this connection ID

Any suggestions on how to get the output into Matlab.

Cheers

Contact us