how to create a job or write on a matlab file?

i have a job from another software and is unknown for me, the quantity of variables depends of 'a' defined by a user, i need to create every job on a matlab file.
a=1;
matlabbatch{1}.spm.stats.factorial_design.dir = '<UNDEFINED>';
matlabbatch{1}.spm.stats.factorial_design.des.t1.scans = ...
{'E:\archivos\proyecto de grado\cerebro\basic models\s3081-0003-00001-000001-01.nii,1'
'E:\archivos\proyecto de grado\cerebro\basic models\s3400-0003-00001-000001-01.nii,1'};
matlabbatch{1}.spm.stats.factorial_design.cov.c = [2
2
2];
matlabbatch{1}.spm.stats.factorial_design.cov.cname = 'covOneSample';
matlabbatch{1}.spm.stats.factorial_design.cov.iCFI = 1;
matlabbatch{1}.spm.stats.factorial_design.cov.iCC = 1;
but if users input is 2 i need to create a file.m that contains this:
matlabbatch{1}.spm.stats.factorial_design.dir = '<UNDEFINED>';
matlabbatch{1}.spm.stats.factorial_design.des.t1.scans = {
'E:\archivos\proyecto de grado\cerebro\basic models\s3081-0003-00001-000001-01.nii,1'
'E:\archivos\proyecto de grado\cerebro\basic models\s3400-0003-00001-000001-01.nii,1'
};
matlabbatch{1}.spm.stats.factorial_design.cov.c = [2
2
2];
matlabbatch{1}.spm.stats.factorial_design.cov.cname = 'covOneSample';
matlabbatch{1}.spm.stats.factorial_design.cov.iCFI = 1;
matlabbatch{1}.spm.stats.factorial_design.cov.iCC = 1;
matlabbatch{1}.spm.stats.factorial_design.dir = '<UNDEFINED>';
matlabbatch{1}.spm.stats.factorial_design.des.t1.scans = {
'E:\archivos\proyecto de grado\cerebro\basic models\s3081-0003-00001-000001-01.nii,1'
'E:\archivos\proyecto de grado\cerebro\basic models\s3400-0003-00001-000001-01.nii,1'
};
matlabbatch{1}.spm.stats.factorial_design.cov(2).c = [2
2
2];
matlabbatch{1}.spm.stats.factorial_design.cov(2).cname = 'covOneSample';
matlabbatch{1}.spm.stats.factorial_design.cov(2).iCFI = 1;
matlabbatch{1}.spm.stats.factorial_design.cov(2).iCC = 1;

댓글 수: 4

Steven - can you describe what you mean by job?
my software starts with BasicModels.m when you do click on covariables you can configure how many variables want to include and other things.
After you give values to the covariables then in BasicModels.m you select "oneSampleTtest" with the popupmenu1_Callback, i need to know how i can create a file whit the structure called matlabbatch{1}.
i hope you understand me, i will attach the files.
Does this have to do with Simulink?
no

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

도움말 센터File Exchange에서 Get Started with MATLAB에 대해 자세히 알아보기

질문:

2015년 1월 23일

댓글:

2015년 1월 25일

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by