Dear Gemma,
It's hard to see from this piece of code what the problem is. But for
instance, you could check the variable 'condlist' and where it comes
from. If the contents of condlist have nothing in common with the
condition labels of the actual datasets then the sorting will not
work.
Best,
Vladimir
On Mon, Jul 30, 2012 at 12:03 PM, Gemma B
<[log in to unmask]> wrote:
> Hi,
>
> I wonder if anyone can help... I am running an EEG analysis script in MATLAB using SPM using a script my MSc supervisor gave me. I am having a problem when I get to the sorting stage. I ran my script (including sorting) with no MATLAB errors and went on to create my design matrix for my statistical tests but when I came to select the scans to input for statistical analysis the filenames of the scans relating to any one condition were different across participants. (The folders for each condition had been created in the same order but the filenames inside were not consistent across participants). It seems to me that the scans have not been sorted but I don't know why or how to fix this (being somewhat a MATLAB novice). Please see a section of the script I was given below:
>
> if sorting==1
> prefix='aedff';
> file=[prefix 'spm8_gemma_msc_' subj_dir(2:5) '.mat'];
> S = [];
> S.D = file;
> % for k=1:length(condition_labels)
> % a(k)=cellstr(num2str(condition_labels(k)))
> % end
> S.condlist = condlist;
> spm_eeg_sort_conditions(S)
> end
>
> N.B. I have obviously checked that I have inputted sorting=1.
>
> It seems odd to me that the script doesn't contain the command 'sort'?
>
> Thanks in advance for any help you can offer.
>
> Best,
>
> Gemma.
|