Hello everyone,
i am a clinical neuropsychologist at the Amsterdam Medical Center doing fMRI research on the limbic and mesocortical dopaminergic system in patients with Schizophrenia.I am using MATLAB with SPM i have a script but i am absolutely not knowledgable on reading scripts so i was hoping somebody may find the time to help me out! This is the script,
>>
>> if ispc,
WinLinSlash='';
kopie = '!copy';
else
WinLinSlash='/';
kopie = '!cp'
end
if isempty(code_num) == 1 % if no code_num is specified
[code_num] = input(['0']);
end
lijst = dir;
if isempty(subj_name) == 1 % if no subject name is specified
% define names that need to be extended
disp(' 1400,1')
naam = pwd; % define extension
x = find(naam(:)== [WinLinSlash]);
extension = naam(1,max(x)+1:end);
if size(extension,2) == 7
if extension == 'workdir' % then go back 1 level to obtain subjectname
extension = naam(1,x(end-1,1)+1:max(x)-1);
end
end
else extension = subj_name;
end
disp(['0'])
extension(1,end+1)='0';
if code_num ~= 0 % if not skipped
disp(' Adding sessionnumber')
extension(1,[end+1:end+length(code_num)]) = num2str(code_num);
extension(1,end+1)='_';
elseif code_num == 0
extension = extension;
end
disp([' Prepending : ',extension,' '])
aantal_files = size (lijst); % which files need to be extended?
for i = 1 : aantal_files(1,1)
grootte = size (lijst(i).name);
if grootte(1,2) > 3
extens_tmp = extension;
extens_tmp(1,end+1:end+grootte(1,2))=lijst(i).name;
eval([kopie,' ',lijst(i).name,' ',extens_tmp,'']); % copy files from old name to new name
end
end
disp(' Done!')
(c) Matthijs Vink UMC Medical center.
and this is the error code i get
??? Undefined function or variable "code_num".
Comments
Probably it misses the function declaration in the first line.
Is it all the code you have?
Please, if you have other questions post in www.sosmatlab.com.
Geor