-1

I'm wondering if it's possible to extract the table that results when running ANOVA to an Excel or .csv file. I'm running a repeated measures two-way ANOVAs with RMAOV2 (http://uk.mathworks.com/matlabcentral/fileexchange/5578-rmaov2). Here is the code I'm using, which works fine, and it produces a table with the ANOVA results.

dir ='/Users/Documents/folder';
cd(dir)
file = readtable('file.csv');
toAnalyse = table2array(file);
RMAOV2(toAnalyse);

However, when I tried to save the ANOVA results in order to then export them to Excel or in a .csv file, this doesn't work:

ANOVAresults = RMAOV2(toAnalyse);

Error:
Output argument "RMAOV2" (and maybe others) not assigned during call to "RMAOV2".

Any suggestion would be very appreciated.

dede
  • 1,129
  • 5
  • 15
  • 35
  • When using 3rd party functions, please include a link to the function. Further, your problems seems unrelated to the exporting process as it already fails when processing the data. – Daniel Jan 14 '16 at 12:34
  • You have to stick to the way RMAOV uses number to code for conditions. It is very specific to this function. – marsei Jan 14 '16 at 13:18
  • The function RMAOV2 works fine. What I'm not able to do, and that I would like to, is to find a way to save the results obtained to export them outside Matlab. – dede Jan 14 '16 at 13:20
  • If it displays the correct table in the command window, then you can use `evalc` to capture the text output. Quite tricky to parse after that. I would modify the RMOAV function instead, to get the desired output in column format. – marsei Jan 14 '16 at 13:30

1 Answers1

0

If you take a look into the source code of the file, you will notice that it never assigns anything to the return variable. Instead it only prints data to the command window.

To resolve this problem you have to edit the source code and assign the data you want to return. Alternatively you can contact the Autor.

Daniel
  • 36,610
  • 3
  • 36
  • 69