LLN, le 21/01/05
Dear Andrew,
I don't know if this is the best/easiest/more elegant way to do it,
but the following lines of code create new contrasts and add them to
the last one found.
- paste the lines in a "filename.m" file,
- duplicate lines 2-4 for each contrast and adapt "contrast_name" and
"contrast_weights" with your contrast specifications,
- put the "filename.m" file in the directory of your analysis,
- once the model has been estimated, simply type "filename" at the
matlab prompt (make sure you're in the good directory!).
This works for us with SPM2.
Yours,
Mauro.
-------------------------
load SPM.mat
cname='contrast_name'; % e.g.,'Cond1-Cond2'
c=[contrast_weights]; % e.g., [1 0 1 0 1 0 1 0 zeros(1,4)]
SPM.xCon(end + 1)=spm_FcUtil('Set',cname,'T','c',c(:),SPM.xX.xKXs);
spm_contrasts(SPM);
-------------------------
>Dear SPMers,
>
>I would like to define several standard contrasts for many subjects.
>Doing it by hand each time is a little tedious.
>
>Is there a way (a utility matlab function, a hack) to achieve this. I
>found that simply substituting SPM.xCon form one SPM.mat file into
>another does not work -- Error: Cant open image file.
>
>I would greatly appreciate any suggestions.
>
>--
>Andrew V. Poliakov, Ph.D.
>Structural Informatics Group,
>Department of Biological Structure,
>University of Washington, Box 357420,
>Seattle, WA 98195
>Voice: (206) 685 2154,
>Fax (206) 543 1524,
>E-mail: [log in to unmask]
--
_____________________________________
Help fighting hunger: http://www.hungersite.com
Just click your mouse and sponsors of The Hunger Site donate a
serving of food to a person in need - at no cost to you.
______________________________________
Mauro PESENTI
Research Associate, National Fund for Scientific Research (Belgium)
Unite de Neurosciences Cognitives
Departement de Psychologie
Universite Catholique de Louvain
Place Cardinal Mercier, 10
B-1348 Louvain-la-Neuve
tel.: +32 (0)10 47 88 22
fax: +32 (0)10 47 37 74
E-mail: [log in to unmask]
http://www.nesc.ucl.ac.be
http://www.nesc.ucl.ac.be/mp/pesentiHomepage.htm
|