Doxygen Source Code Documentation
TaskTest.m
Go to the documentation of this file.00001 function [err,tasktest] = TaskTest (N_runs, polort, N_basis, N_tasks, Task, N_base)
00002 %
00003 % [err,] = ContrTest ()
00004 %
00005 %Purpose:
00006 %
00007 % Generate matrix for the -glt option in 3dDevolve
00008 %
00009 %Input Parameters:
00010 %
00011 %
00012 %
00013 %Output Parameters:
00014 % err : 0 No Problem
00015 % : 1 Problems
00016 %
00017 %
00018 %
00019 %Key Terms:
00020 %
00021 %More Info :
00022 %
00023 %
00024 %
00025 %
00026 % Author : Gang Chen
00027 % Date : Mon Jul 21 18:25:31 EDT 2003
00028 % SSCC/NIMH/ National Institutes of Health, Bethesda Maryland
00029
00030
00031 %Define the function name for easy referencing
00032 FuncName = 'TaskTest';
00033
00034 %Debug Flag
00035 DBG = 1;
00036
00037 %initailize return variables
00038 err = 1;
00039
00040 %Create a matrix so that 3dDeconvolve uses for regressor test.
00041
00042 mtrx = zeros(N_tasks, (polort+1)*N_runs+N_basis*N_tasks+N_base); %for each run, there are (polort+1) paramters in the baseline model
00043 fprintf(1, 'Your task vectors for -glt options are:\n');
00044
00045 for (i = 1:1:N_tasks),
00046 fprintf(1,'No. %i task vector = ', i);
00047 tasktest(i).name = sprintf('%s_task.1D',Task(i).Label);
00048 fid = fopen(tasktest(i).name, 'w');
00049 for (j = 1:1:N_basis),
00050 % mtrx(i,(i-1)*N_basis+j+(polort+1)*N_runs) = 1; %Assign one 1 for each basis function of every task
00051 mtrx((i-1)*N_basis+j,(i-1)*N_basis+j+(polort+1)*N_runs) = 1;
00052 for (k = 1:1:(polort+1)*N_runs+N_basis*N_tasks+N_base),
00053 fprintf(1, '%g ', mtrx((i-1)*N_basis+j,k));
00054 fprintf(fid, '%g ', mtrx((i-1)*N_basis+j,k));
00055 end
00056 fprintf(fid, '\n');
00057 end
00058 % for (k = 1:1:(polort+1)*N_runs+N_basis*N_tasks),
00059 % fprintf(1, '%g ', mtrx(i,k));
00060 % fprintf(fid, '%g ', mtrx(i,k));
00061 % end
00062 fprintf(1, '\n');
00063 fclose(fid);
00064 end
00065
00066 err = 0;
00067 return;