Line 37/66 are both wrong. You never closed the {{ at the beginning of the line. You need }} at the end of each before the ;

Also remove the } on line 38.

You do not want to use exit. You should use return to return to MATLAB. exit will close the program and is generally not included in scripts/functions.



Best Regards, Donald McLaren
=================
D.G. McLaren, Ph.D.
Postdoctoral Research Fellow, GRECC, Bedford VA
Research Fellow, Department of Neurology, Massachusetts General Hospital and
Harvard Medical School
Office: (773) 406-2464
=====================
This e-mail contains CONFIDENTIAL INFORMATION which may contain PROTECTED
HEALTHCARE INFORMATION and may also be LEGALLY PRIVILEGED and which is
intended only for the use of the individual or entity named above. If the
reader of the e-mail is not the intended recipient or the employee or agent
responsible for delivering it to the intended recipient, you are hereby
notified that you are in possession of confidential and privileged
information. Any unauthorized use, disclosure, copying or the taking of any
action in reliance on the contents of this information is strictly
prohibited and may be unlawful. If you have received this e-mail
unintentionally, please immediately notify the sender via telephone at (773)
406-2464 or email.



On Tue, Jan 31, 2012 at 10:57 AM, Omar Mothersill <[log in to unmask]> wrote:
Dear SPM users,

I keep getting an error when I try to run a script I wrote for a first level analysis, but I can't figure out what the problem is.  The errors are:

Lines 40 and 67:    Invalid syntax at '='
Line 137:               Program ends prematurely (or earlier error confused with M-Lint)

I've enclosed the .m file in question, which I created by making a a first level analysis job in the GUI batch editor, saving it as a .m file, and adding relevant commands to the beginning and end.

If anyone has any advice it would be greatly appreciated.

Kind regards,

Omar

--
Omar Mothersill

Room 0.18
Neuropsychiatric Genetics Group
Dept. of Psychiatry
Trinity Centre for Health Sciences
St. James's Hospital
Dublin 8.

Phone: 01 896 2464
Email: [log in to unmask]