This is a collaborative space. In order to contribute, send an email to maximilien.chaumon@icm-institute.org
On any page, type the letter L on your keyboard to add a "Label" to the page, which will make search easier.

Script

How to write a script

  • open a New File in Matlab Menu (File/New/M-File): This will open a new editor window
  • Write down your MyStructure variable as below: (Suppose you have only .lena files)
    <file>
     MyStructure{1,1,1}= {'file1111.lena', 'file1112.lena', .... 'file111n.lena'};
     MyStructure{1,1,2}= {'file1121.lena', 'file1122.lena', .... 'file112n.lena'};
     MyStructure{1,2,1}= {'file1211.lena', 'file1212.lena', .... 'file121n.lena'};
     .
     .
     .
     MyStructures{2,3,2}= {'file2321.lena', 'file2322.lena', .... 'file232n.lena'};
     </file>



Suppose in addition that all these files are located in /lena13/home_users/users/datalinks/Manip.
Note: if the input files are not all located in the same directoy, you have to specify it inside the MyStructure structure as follows:
<file>
MyStructure{1,1,2}= {'subject01/file1121.lena', 'subject02/file1122.lena', ....'subject0i/file112i.lena', .........., 'subject0n/file112n.lena'};
</file>
where file112i.lena is located in directory subject0i and subject0i itself is inside '/lena13/home_users/users/datalinks/Manip
Please pay a great attention to the use of the '/' inside the 'PathIn' argument. The concatenation of the 'PathIn' argument and the lenaFiles files must give the correct location of the input file.
Once your 'FileStruct' is created, you add at the end of your M-File the mega_anova function as follows:





<file>
mega_anova('FactorLevel', [2,3,2], 'FileStruct', MyStructure, 'PathIn', '/lena13/home_users/users/datalinks/MyManip/','PathOut', '/lena13/home_users/users/datalinks/MYMANIP/MyAnovaResult', 'FilePrefix','anovaResult')
</file>
This will perform three factors anova with repeated measurements on input files of MyStructure structure.





It is also possible to select some datablocks, sensors or a time window inside the input files as follows:





<file>
mega_anova('FactorLevel', [2,3,2], 'FileStruct', MyStructure, 'PathIn', '/lena13/home_users/users/datalinks/MyManip/','PathOut', '/lena13/home_users/users/datalinks/MYMANIP/MyAnovaResult', 'FilePrefix','anovaResult', 'datablocks', {'trial0'; 'trial1'}, 'sensorList', {'MLC11-612', 'MLC12-612'}, 'timeRange', [0, 0.1])
</file>
This will perform three factors anova with repeated measurements on input files of MyStructure structure but only on 'trial0' and 'trial1', MLC11-612 and MLC12-612 sensors and for 0 s to 0.1 s duration.





As an output, it will produce the following files

  • Main effects
    anovaResultF1.lena , anovaResultp1.lena
    anovaResultF2.lena , anovaResultp2.lena
    anovaResultF3.lena , anovaResultp3.lena
  • Interaction effects
    anovaResultF12.lena , anovaResultp12.lena
    anovaResultF13.lena , anovaResultp13.lena
    anovaResultF23.lena , anovaResultp23.lena
	anovaResultF123.lena , anovaResultp123.lena

These files will be written in /lena13/home_users/users/datalinks/MYMANIP/MyAnovaResult. Note that the use of the '/' for 'PathOut' argument is not required .

Back