Errors when 'bridging' two programmes together.
显示 更早的评论
Hi,
I am currently working on a toolbox, where I have created plugins to create a nicer user interface.
It's a pretty long program but hopefully what I have supplied below is enough please ask for more info in required.
I have tried to set the format so it is easy to read...I hope it has worked!!
User-interface code (menu):
cv_none = cfg_const; % For if no covariates are used (default)
cv_none.tag = 'cv_none';
cv_none.name = 'None';
cv_none.val = {1};
cv_none.help = {'Covariate value = none'};
cov_Val = cfg_entry; %For if a covariate value needs to be entered...enter value
cov_Val.tag = 'cov_Val';
cov_Val.name = 'Enter Number of Covariate';%arbitary name
cov_Val.help = {'Help'};
cov_Val.strtype = 'e';
cov_Val.num = [Inf 1];
cv_one = cfg_branch; %Text display of this option in menu
cv_one.tag = 'cv_one';
cv_one.name = 'Enter Different Covariate Value';
cv_one.val = {cov_Val};
cv_one.help = {'Help'};
covariate = cfg_choice; %Menu showing an option
covariate.tag = 'covariate';
covariate.name = 'Covariate'; %arbitary name
covariate.val = {cv_none };
covariate.help = {'Help'};
covariate.values = {cv_none cov_Val };
%% Executable Branch
snpmui = snpm_cfg_ui(DesNm,DesFile,DesHelp,{covariate}); % In the configure file (separate)
Code for the plugin to be able to run the software (where the errors are pointing me towards!):
if BATCH
covariate = job.covariate(:);
if ~all(size(covariate)==[nScan,1])
error(sprintf('Covariate [%d,1] does not match number of subjects [%d]',...
size(covariate,1),nScan))
end
else
covariate = [];
while ~all(size(cov_Val)==[nScan,1])
covariate = spm_input(sprintf('Enter covariate values
[%d]',nScan),'+1');
covariate = cov_Val(:);
end
end
The error I am getting when I insert '12' into the space for "Enter covariate value"
------------------------------------------------------------------------
Running job #1
------------------------------------------------------------------------
Running 'MultiSub: One Sample T test on diffs/contrasts'
Failed 'MultiSub: One Sample T test on diffs/contrasts'
Error using ==> snpm_pi_OneSampT at 115
Covariate [1,1] doesn't match number of subjects [12]
In file
"C:\Users\Emma\Documents\Project\snpm10_devel\snpm_pi_OneSampT.m" (???), function "snpm_pi_OneSampT" at line 115.
In file "C:\Users\Emma\Documents\Project\snpm10_devel\snpm_ui.m" (???), function "snpm_ui" at line 297.
In file "C:\Users\Emma\Documents\Project\snpm10_devel\config\snpm_run_ui.m" (???), function "snpm_run_ui" at line 12.
The following modules did not run:
Failed: MultiSub: One Sample T test on diffs/contrasts
Thank you for reading, I appreciate you're time :)
Emma T
采纳的回答
更多回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Managing Data 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!