mfiles:mfiles
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revision | |||
mfiles:mfiles [2010/12/13 15:22] – lennartfr | mfiles:mfiles [2010/12/13 15:34] (current) – lennartfr | ||
---|---|---|---|
Line 1113: | Line 1113: | ||
====== Files written autumn 2010 ====== | ====== Files written autumn 2010 ====== | ||
+ | |||
+ | ==== table2allCohortsModel.m ==== | ||
+ | |||
+ | <file txt table2allCohortsModel.m> | ||
+ | function table2allCohortsModel(startyear, | ||
+ | surveyfile, datfile, include_weight_maturity); | ||
+ | % table2allCohortsModel(startyear, | ||
+ | |||
+ | |||
+ | fid = fopen(datfile,' | ||
+ | |||
+ | try, | ||
+ | fprintf(fid,'# | ||
+ | |||
+ | fprintf(fid,'# | ||
+ | |||
+ | fprintf(fid,'# | ||
+ | |||
+ | fprintf(fid,'# | ||
+ | |||
+ | C = load(catchfile); | ||
+ | |||
+ | startyear_row = find(C(:,1) == startyear); | ||
+ | endyear_row = find(C(:,1) == endyear); | ||
+ | | ||
+ | minage_col = find(C(1,:) == minage); | ||
+ | maxage_col = find(C(1,:) == maxage); | ||
+ | | ||
+ | for (i=startyear_row: | ||
+ | for (j=minage_col: | ||
+ | fprintf(fid,' | ||
+ | end; | ||
+ | fprintf(fid,' | ||
+ | end; | ||
+ | | ||
+ | | ||
+ | fprintf(fid,'# | ||
+ | S = load(surveyfile); | ||
+ | | ||
+ | startyear_row = find(S(:,1) == startyear); | ||
+ | endyear_row = find(S(:,1) == endyear); | ||
+ | | ||
+ | minage_col = find(S(1,:) == minage); | ||
+ | maxage_col = find(S(1,:) == maxage); | ||
+ | | ||
+ | for (i=startyear_row: | ||
+ | for (j=minage_col: | ||
+ | fprintf(fid,' | ||
+ | end; | ||
+ | fprintf(fid,' | ||
+ | end; | ||
+ | | ||
+ | if (exist(' | ||
+ | | ||
+ | mature_3_12_2009; | ||
+ | weight_3_11_2009; | ||
+ | mature = mature'; | ||
+ | weight = weight'; | ||
+ | | ||
+ | fprintf(fid,'# | ||
+ | startyear_row = find(mature(:, | ||
+ | endyear_row = find(mature(:, | ||
+ | | ||
+ | minage_col = find(mature(1,: | ||
+ | maxage_col = find(mature(1,: | ||
+ | | ||
+ | for (i=startyear_row: | ||
+ | for (j=minage_col: | ||
+ | fprintf(fid,' | ||
+ | end; | ||
+ | fprintf(fid,' | ||
+ | end; | ||
+ | | ||
+ | | ||
+ | | ||
+ | fprintf(fid,'# | ||
+ | startyear_row = find(weight(:, | ||
+ | endyear_row = find(weight(:, | ||
+ | | ||
+ | minage_col = find(weight(1,: | ||
+ | maxage_col = find(weight(1,: | ||
+ | | ||
+ | for (i=startyear_row: | ||
+ | for (j=minage_col: | ||
+ | fprintf(fid,' | ||
+ | end; | ||
+ | fprintf(fid,' | ||
+ | end; | ||
+ | | ||
+ | get_sondre_data; | ||
+ | csd = [nan sondre_ages; | ||
+ | | ||
+ | fprintf(fid,'# | ||
+ | startyear_row = find(csd(:, | ||
+ | endyear_row = find(csd(:, | ||
+ | | ||
+ | minage_col = find(csd(1,: | ||
+ | maxage_col = find(csd(1,: | ||
+ | | ||
+ | for (i=startyear_row: | ||
+ | for (j=minage_col: | ||
+ | fprintf(fid,' | ||
+ | end; | ||
+ | fprintf(fid,' | ||
+ | end; | ||
+ | | ||
+ | | ||
+ | end; | ||
+ | | ||
+ | | ||
+ | fclose(fid); | ||
+ | |||
+ | catch, | ||
+ | fprintf(2,' | ||
+ | fclose(fid); | ||
+ | end; | ||
+ | |||
+ | |||
+ | </ |
mfiles/mfiles.txt · Last modified: 2010/12/13 15:34 by lennartfr