%
% Invoke this script to create the corresponding model
%

% Create the system (either model or library) and open it

new_system('F16_gnc','Model');
load_system('simulink');
open_system('F16_gnc');
set_param('F16_gnc','Location', [70, 200, 670, 990]);
% pause(0.1); - disabled with R2006b/7.3; causes typeahead buffer overflow

% Execute the setup script to create the data structure
% in the model workspace for clarity

mws = get_param('F16_gnc','modelworkspace');
if ~exist('mws')
  error('Unable to open model workspace - aborting');
end
mws.clear;
mws.evalin('F16_gnc_data','F16_gnc_setup');
clear mws;

% Create the subsystem with proper size to accomodate in/out ports

add_block('built-in/subsystem','F16_gnc/F16_gnc','Position',[210, 45, 390, 740]);

% Flesh out subsystem with internal blocks

    add_block('built-in/Constant','F16_gnc/F16_gnc/const_5','ShowName','off','Value','60.0','Position',[30,39,90,69]);
    add_block('built-in/Product','F16_gnc/F16_gnc/times_5','Multiplication','Element-wise(.*)','SaturateOnIntegerOverflow','on','Inputs','2','Position',[130,35,160,74]);
    add_block('built-in/Product','F16_gnc/F16_gnc/times_12','Multiplication','Element-wise(.*)','SaturateOnIntegerOverflow','on','Inputs','2','Position',[200,35,230,74]);
    add_block('built-in/Sum','F16_gnc/F16_gnc/minus_11','IconShape','rectangular','Inputs','+-','Position',[270,35,300,74]);
    add_block('built-in/Switch','F16_gnc/F16_gnc/switch_40','Threshold','0.5','Position',[690,27,720,81]);
    add_block('built-in/Product','F16_gnc/F16_gnc/times_47','Multiplication','Element-wise(.*)','SaturateOnIntegerOverflow','on','Inputs','2','Position',[760,35,790,74]);
    add_block('built-in/Saturate','F16_gnc/F16_gnc/autopilotCourseCorrection_unlim_limiter','ShowName','off','LowerLimit','-30.0','UpperLimit','30.0','AttributesFormatString','%<LowerLimit> to %<UpperLimit>','Position',[830,39,860,69]);
    add_block('built-in/Sum','F16_gnc/F16_gnc/plus_48','IconShape','rectangular','Inputs','++','Position',[900,35,930,74]);
    add_block('built-in/Sum','F16_gnc/F16_gnc/minus_49','IconShape','rectangular','Inputs','+-','Position',[970,35,1000,74]);
    add_block('built-in/Switch','F16_gnc/F16_gnc/switch_50','Threshold','0.5','Position',[1180,27,1210,81]);
    add_block('built-in/Product','F16_gnc/F16_gnc/times_61','Multiplication','Element-wise(.*)','SaturateOnIntegerOverflow','on','Inputs','2','Position',[1250,35,1280,74]);
    add_block('built-in/Saturate','F16_gnc/F16_gnc/autopilotCommandedBankAngle_unlim_limiter','ShowName','off','LowerLimit','-30.0','UpperLimit','30.0','AttributesFormatString','%<LowerLimit> to %<UpperLimit>','Position',[1320,39,1350,69]);
    add_block('built-in/Switch','F16_gnc/F16_gnc/switch_68','Threshold','0.5','Position',[1390,27,1420,81]);
    add_block('built-in/Sum','F16_gnc/F16_gnc/minus_74','IconShape','rectangular','Inputs','+-','Position',[1460,35,1490,74]);
    add_block('built-in/Product','F16_gnc/F16_gnc/times_90','Multiplication','Element-wise(.*)','SaturateOnIntegerOverflow','on','Inputs','2','Position',[1530,35,1560,74]);
    add_block('built-in/Sum','F16_gnc/F16_gnc/plus_89','IconShape','rectangular','Inputs','++++','Position',[1600,20,1630,89]);
    add_block('built-in/Gain','F16_gnc/F16_gnc/minus_88','Gain','-1','Position',[1670,39,1700,69]);
    add_block('built-in/Switch','F16_gnc/F16_gnc/switch_108','Threshold','0.5','Position',[1740,27,1770,81]);
    add_block('built-in/Sum','F16_gnc/F16_gnc/plus_133','IconShape','rectangular','Inputs','++','Position',[1810,35,1840,74]);
    add_block('built-in/Saturate','F16_gnc/F16_gnc/totalLatCmd_unlim_limiter','ShowName','off','LowerLimit','-1.0','UpperLimit','1.0','AttributesFormatString','%<LowerLimit> to %<UpperLimit>','Position',[1880,39,1910,69]);
    add_block('built-in/Product','F16_gnc/F16_gnc/times_138','Multiplication','Element-wise(.*)','SaturateOnIntegerOverflow','on','Inputs','2','Position',[1950,35,1980,74]);
    add_block('built-in/Product','F16_gnc/F16_gnc/times_143','Multiplication','Element-wise(.*)','SaturateOnIntegerOverflow','on','Inputs','2','Position',[2020,35,2050,74]);
    add_block('built-in/Sum','F16_gnc/F16_gnc/plus_140','IconShape','rectangular','Inputs','++','Position',[2090,35,2120,74]);
    add_block('built-in/Outport','F16_gnc/F16_gnc/rudderDeflection','Position',[2160,47,2190,61]);
    add_block('built-in/Outport','F16_gnc/F16_gnc/aileronDeflection','Position',[2020,109,2050,123]);
    add_block('built-in/Product','F16_gnc/F16_gnc/times_96','Multiplication','Element-wise(.*)','SaturateOnIntegerOverflow','on','Inputs','2','Position',[1530,158,1560,197]);
    add_block('built-in/Sum','F16_gnc/F16_gnc/plus_95','IconShape','rectangular','Inputs','++++','Position',[1600,143,1630,212]);
    add_block('built-in/Gain','F16_gnc/F16_gnc/minus_94','Gain','-1','Position',[1670,162,1700,192]);
    add_block('built-in/Switch','F16_gnc/F16_gnc/switch_112','Threshold','0.5','Position',[1740,150,1770,204]);
    add_block('built-in/Sum','F16_gnc/F16_gnc/plus_134','IconShape','rectangular','Inputs','++','Position',[1810,158,1840,197]);
    add_block('built-in/Saturate','F16_gnc/F16_gnc/totalDirCmd_unlim_limiter','ShowName','off','LowerLimit','-1.0','UpperLimit','1.0','AttributesFormatString','%<LowerLimit> to %<UpperLimit>','Position',[1880,162,1910,192]);
    add_block('built-in/Product','F16_gnc/F16_gnc/times_141','Multiplication','Element-wise(.*)','SaturateOnIntegerOverflow','on','Inputs','2','Position',[1950,158,1980,197]);
    add_block('built-in/Sum','F16_gnc/F16_gnc/minus_52','IconShape','rectangular','Inputs','+-','Position',[1040,240,1070,279]);
    add_block('built-in/Switch','F16_gnc/F16_gnc/switch_51','Threshold','0.5','Position',[1110,232,1140,286]);
    add_block('built-in/RelationalOperator','F16_gnc/F16_gnc/gt_54','Position',[1040,306,1070,345],'Operator','>');
    add_block('built-in/Sum','F16_gnc/F16_gnc/plus_56','IconShape','rectangular','Inputs','++','Position',[1040,365,1070,404]);
    add_block('built-in/Abs','F16_gnc/F16_gnc/abs_59','Position',[1040,428,1070,458]);
    add_block('built-in/RelationalOperator','F16_gnc/F16_gnc/gt_58','Position',[1110,424,1140,463],'Operator','>');
    add_block('built-in/Product','F16_gnc/F16_gnc/times_22','Multiplication','Element-wise(.*)','SaturateOnIntegerOverflow','on','Inputs','2','Position',[200,483,230,522]);
    add_block('built-in/Product','F16_gnc/F16_gnc/times_32','Multiplication','Element-wise(.*)','SaturateOnIntegerOverflow','on','Inputs','2','Position',[270,483,300,522]);
    add_block('built-in/Sum','F16_gnc/F16_gnc/plus_30','IconShape','rectangular','Inputs','++','Position',[480,483,510,522]);
    add_block('built-in/Math','F16_gnc/F16_gnc/power_29','Operator','pow','Position',[550,483,580,522]);
    add_block('built-in/Sum','F16_gnc/F16_gnc/minus_39','IconShape','rectangular','Inputs','+-','Position',[620,483,650,522]);
    add_block('built-in/Trigonometry','F16_gnc/F16_gnc/atan2_36','Operator','atan2','Position',[410,550,440,589]);
    add_block('built-in/Product','F16_gnc/F16_gnc/times_35','Multiplication','Element-wise(.*)','SaturateOnIntegerOverflow','on','Inputs','2','Position',[480,550,510,589]);
    add_block('built-in/Product','F16_gnc/F16_gnc/divide_34','Multiplication','Element-wise(.*)','SaturateOnIntegerOverflow','on','Inputs','*/','Position',[550,550,580,589]);
    add_block('built-in/Switch','F16_gnc/F16_gnc/switch_43','Threshold','0.5','Position',[620,542,650,596]);
    add_block('built-in/Product','F16_gnc/F16_gnc/times_23','Multiplication','Element-wise(.*)','SaturateOnIntegerOverflow','on','Inputs','3','Position',[340,616,370,670]);
    add_block('built-in/Product','F16_gnc/F16_gnc/times_31','Multiplication','Element-wise(.*)','SaturateOnIntegerOverflow','on','Inputs','2','Position',[410,624,440,663]);
    add_block('built-in/Constant','F16_gnc/F16_gnc/const_6','ShowName','off','Value','6076.12','Position',[30,690,90,720]);
    add_block('built-in/Constant','F16_gnc/F16_gnc/const_8','ShowName','off','Value','3.0','Position',[30,744,90,774]);
    add_block('built-in/Product','F16_gnc/F16_gnc/times_8','Multiplication','Element-wise(.*)','SaturateOnIntegerOverflow','on','Inputs','2','Position',[130,740,160,779]);
    add_block('built-in/Constant','F16_gnc/F16_gnc/const_9','ShowName','off','Value','6076.12','Position',[30,799,90,829]);
    add_block('built-in/Constant','F16_gnc/F16_gnc/const_13','ShowName','off','Value','90.0','Position',[30,853,90,883]);
    add_block('built-in/Sum','F16_gnc/F16_gnc/minus_13','IconShape','rectangular','Inputs','+-','Position',[130,849,160,888]);
    add_block('built-in/Constant','F16_gnc/F16_gnc/const_16','ShowName','off','Value','180.0','Position',[30,920,90,950]);
    add_block('built-in/Sum','F16_gnc/F16_gnc/minus_16','IconShape','rectangular','Inputs','+-','Position',[130,916,160,955]);
    add_block('built-in/Switch','F16_gnc/F16_gnc/switch_15','Threshold','0.5','Position',[200,908,230,962]);
    add_block('built-in/Constant','F16_gnc/F16_gnc/const_18','ShowName','off','Value','0.','Position',[30,986,90,1016]);
    add_block('built-in/RelationalOperator','F16_gnc/F16_gnc/gt_18','Position',[130,982,160,1021],'Operator','>');
    add_block('built-in/Constant','F16_gnc/F16_gnc/const_20','ShowName','off','Value','180.0','Position',[30,1045,90,1075]);
    add_block('built-in/Sum','F16_gnc/F16_gnc/plus_20','IconShape','rectangular','Inputs','++','Position',[130,1041,160,1080]);
    add_block('built-in/Constant','F16_gnc/F16_gnc/const_26','ShowName','off','Value','3.14159265','Position',[30,1104,90,1134]);
    add_block('built-in/Product','F16_gnc/F16_gnc/divide_26','Multiplication','Element-wise(.*)','SaturateOnIntegerOverflow','on','Inputs','*/','Position',[130,1100,160,1139]);
    add_block('built-in/Product','F16_gnc/F16_gnc/times_25','Multiplication','Element-wise(.*)','SaturateOnIntegerOverflow','on','Inputs','2','Position',[200,1100,230,1139]);
    add_block('built-in/Trigonometry','F16_gnc/F16_gnc/cos_24','Operator','cos','Position',[270,1104,300,1134]);
    add_block('built-in/Constant','F16_gnc/F16_gnc/const_27','ShowName','off','Value','180.0','Position',[30,1159,90,1189]);
    add_block('built-in/Constant','F16_gnc/F16_gnc/const_32','ShowName','off','Value','0.5','Position',[30,1209,90,1239]);
    add_block('built-in/Constant','F16_gnc/F16_gnc/const_36','ShowName','off','Value','-180.0','Position',[30,1259,90,1289]);
    add_block('built-in/Constant','F16_gnc/F16_gnc/const_37','ShowName','off','Value','3.14159265','Position',[30,1309,90,1339]);
    add_block('built-in/Constant','F16_gnc/F16_gnc/const_41','ShowName','off','Value','0.5','Position',[30,1363,90,1393]);
    add_block('built-in/RelationalOperator','F16_gnc/F16_gnc/gt_41','Position',[130,1359,160,1398],'Operator','>');
    add_block('built-in/Constant','F16_gnc/F16_gnc/const_44','ShowName','off','Value','0.5','Position',[30,1422,90,1452]);
    add_block('built-in/RelationalOperator','F16_gnc/F16_gnc/gt_44','Position',[130,1418,160,1457],'Operator','>');
    add_block('built-in/Constant','F16_gnc/F16_gnc/const_52','ShowName','off','Value','360.0','Position',[30,1477,90,1507]);
    add_block('built-in/Constant','F16_gnc/F16_gnc/const_54','ShowName','off','Value','0.','Position',[30,1527,90,1557]);
    add_block('built-in/Constant','F16_gnc/F16_gnc/const_56','ShowName','off','Value','360.0','Position',[30,1577,90,1607]);
    add_block('built-in/Constant','F16_gnc/F16_gnc/const_59','ShowName','off','Value','180.0','Position',[30,1627,90,1657]);
    add_block('built-in/Constant','F16_gnc/F16_gnc/const_63','ShowName','off','Value','0.5','Position',[30,1696,90,1726]);
    add_block('built-in/RelationalOperator','F16_gnc/F16_gnc/gt_63','Position',[130,1692,160,1731],'Operator','>');
    add_block('built-in/Switch','F16_gnc/F16_gnc/switch_62','Threshold','0.5','Position',[200,1684,230,1738]);
    add_block('built-in/Sum','F16_gnc/F16_gnc/minus_72','IconShape','rectangular','Inputs','+-','Position',[270,1692,300,1731]);
    add_block('built-in/Product','F16_gnc/F16_gnc/times_78','Multiplication','Element-wise(.*)','SaturateOnIntegerOverflow','on','Inputs','2','Position',[340,1692,370,1731]);
    add_block('built-in/Sum','F16_gnc/F16_gnc/plus_77','IconShape','rectangular','Inputs','++++','Position',[620,1677,650,1746]);
    add_block('built-in/Gain','F16_gnc/F16_gnc/minus_76','Gain','-1','Position',[690,1696,720,1726]);
    add_block('built-in/Switch','F16_gnc/F16_gnc/switch_100','Threshold','0.5','Position',[760,1684,790,1738]);
    add_block('built-in/Sum','F16_gnc/F16_gnc/plus_132','IconShape','rectangular','Inputs','+++','Position',[830,1684,860,1738]);
    add_block('built-in/Saturate','F16_gnc/F16_gnc/totalLongCmd_unlim_limiter','ShowName','off','LowerLimit','-1.0','UpperLimit','1.0','AttributesFormatString','%<LowerLimit> to %<UpperLimit>','Position',[900,1696,930,1726]);
    add_block('built-in/Product','F16_gnc/F16_gnc/times_136','Multiplication','Element-wise(.*)','SaturateOnIntegerOverflow','on','Inputs','2','Position',[970,1692,1000,1731]);
    add_block('built-in/Outport','F16_gnc/F16_gnc/elevatorDeflection','Position',[1040,1704,1070,1718]);
    add_block('built-in/Product','F16_gnc/F16_gnc/times_84','Multiplication','Element-wise(.*)','SaturateOnIntegerOverflow','on','Inputs','2','Position',[340,1781,370,1820]);
    add_block('built-in/Sum','F16_gnc/F16_gnc/plus_83','IconShape','rectangular','Inputs','++++','Position',[620,1766,650,1835]);
    add_block('built-in/Gain','F16_gnc/F16_gnc/minus_82','Gain','-1','Position',[690,1785,720,1815]);
    add_block('built-in/Switch','F16_gnc/F16_gnc/switch_104','Threshold','0.5','Position',[760,1773,790,1827]);
    add_block('built-in/Sum','F16_gnc/F16_gnc/plus_135','IconShape','rectangular','Inputs','+++','Position',[830,1773,860,1827]);
    add_block('built-in/Saturate','F16_gnc/F16_gnc/totalThrottle_unlim_limiter','ShowName','off','LowerLimit','0.0','UpperLimit','1.0','AttributesFormatString','%<LowerLimit> to %<UpperLimit>','Position',[900,1785,930,1815]);
    add_block('built-in/Product','F16_gnc/F16_gnc/times_145','Multiplication','Element-wise(.*)','SaturateOnIntegerOverflow','on','Inputs','2','Position',[970,1781,1000,1820]);
    add_block('built-in/Outport','F16_gnc/F16_gnc/powerLeverAngle','Position',[1040,1793,1070,1807]);
    add_block('built-in/Constant','F16_gnc/F16_gnc/const_66','ShowName','off','Value','0.5','Position',[30,1867,90,1897]);
    add_block('built-in/RelationalOperator','F16_gnc/F16_gnc/gt_66','Position',[130,1863,160,1902],'Operator','>');
    add_block('built-in/Switch','F16_gnc/F16_gnc/switch_65','Threshold','0.5','Position',[410,1855,440,1909]);
    add_block('built-in/Sum','F16_gnc/F16_gnc/minus_75','IconShape','rectangular','Inputs','+-','Position',[480,1863,510,1902]);
    add_block('built-in/Product','F16_gnc/F16_gnc/times_81','Multiplication','Element-wise(.*)','SaturateOnIntegerOverflow','on','Inputs','2','Position',[550,1863,580,1902]);
    add_block('built-in/Product','F16_gnc/F16_gnc/times_87','Multiplication','Element-wise(.*)','SaturateOnIntegerOverflow','on','Inputs','2','Position',[550,1929,580,1968]);
    add_block('built-in/Constant','F16_gnc/F16_gnc/const_69','ShowName','off','Value','0.5','Position',[30,1992,90,2022]);
    add_block('built-in/RelationalOperator','F16_gnc/F16_gnc/gt_69','Position',[130,1988,160,2027],'Operator','>');
    add_block('built-in/Constant','F16_gnc/F16_gnc/const_70','ShowName','off','Value','0.','Position',[30,2047,90,2077]);
    add_block('built-in/Constant','F16_gnc/F16_gnc/const_101','ShowName','off','Value','0.5','Position',[30,2101,90,2131]);
    add_block('built-in/RelationalOperator','F16_gnc/F16_gnc/gt_101','Position',[200,2097,230,2136],'Operator','>');
    add_block('built-in/Constant','F16_gnc/F16_gnc/const_102','ShowName','off','Value','0','Position',[30,2156,90,2186]);
    add_block('built-in/Constant','F16_gnc/F16_gnc/const_105','ShowName','off','Value','0.5','Position',[30,2210,90,2240]);
    add_block('built-in/RelationalOperator','F16_gnc/F16_gnc/gt_105','Position',[200,2206,230,2245],'Operator','>');
    add_block('built-in/Constant','F16_gnc/F16_gnc/const_106','ShowName','off','Value','0','Position',[30,2265,90,2295]);
    add_block('built-in/Constant','F16_gnc/F16_gnc/const_109','ShowName','off','Value','0.5','Position',[30,2319,90,2349]);
    add_block('built-in/RelationalOperator','F16_gnc/F16_gnc/gt_109','Position',[200,2315,230,2354],'Operator','>');
    add_block('built-in/Constant','F16_gnc/F16_gnc/const_110','ShowName','off','Value','0','Position',[30,2374,90,2404]);
    add_block('built-in/Constant','F16_gnc/F16_gnc/const_113','ShowName','off','Value','0.5','Position',[30,2428,90,2458]);
    add_block('built-in/RelationalOperator','F16_gnc/F16_gnc/gt_113','Position',[200,2424,230,2463],'Operator','>');
    add_block('built-in/Constant','F16_gnc/F16_gnc/const_114','ShowName','off','Value','0','Position',[30,2483,90,2513]);
    add_block('built-in/Constant','F16_gnc/F16_gnc/const_117','ShowName','off','Value','0.5','Position',[30,2545,90,2575]);
    add_block('built-in/RelationalOperator','F16_gnc/F16_gnc/lt_117','Position',[130,2541,160,2580],'Operator','<');
    add_block('built-in/Switch','F16_gnc/F16_gnc/switch_116','Threshold','0.5','Position',[200,2533,230,2587]);
    add_block('built-in/Constant','F16_gnc/F16_gnc/const_118','ShowName','off','Value','0','Position',[30,2607,90,2637]);
    add_block('built-in/Constant','F16_gnc/F16_gnc/const_121','ShowName','off','Value','0.5','Position',[30,2669,90,2699]);
    add_block('built-in/RelationalOperator','F16_gnc/F16_gnc/lt_121','Position',[130,2665,160,2704],'Operator','<');
    add_block('built-in/Switch','F16_gnc/F16_gnc/switch_120','Threshold','0.5','Position',[200,2657,230,2711]);
    add_block('built-in/Constant','F16_gnc/F16_gnc/const_122','ShowName','off','Value','0','Position',[30,2731,90,2761]);
    add_block('built-in/Constant','F16_gnc/F16_gnc/const_125','ShowName','off','Value','0.5','Position',[30,2793,90,2823]);
    add_block('built-in/RelationalOperator','F16_gnc/F16_gnc/lt_125','Position',[130,2789,160,2828],'Operator','<');
    add_block('built-in/Switch','F16_gnc/F16_gnc/switch_124','Threshold','0.5','Position',[200,2781,230,2835]);
    add_block('built-in/Constant','F16_gnc/F16_gnc/const_126','ShowName','off','Value','0','Position',[30,2855,90,2885]);
    add_block('built-in/Constant','F16_gnc/F16_gnc/const_129','ShowName','off','Value','0.5','Position',[30,2917,90,2947]);
    add_block('built-in/RelationalOperator','F16_gnc/F16_gnc/lt_129','Position',[130,2913,160,2952],'Operator','<');
    add_block('built-in/Switch','F16_gnc/F16_gnc/switch_128','Threshold','0.5','Position',[200,2905,230,2959]);
    add_block('built-in/Constant','F16_gnc/F16_gnc/const_130','ShowName','off','Value','0','Position',[30,2979,90,3009]);
    add_block('built-in/Constant','F16_gnc/F16_gnc/const_136','ShowName','off','Value','-25.','Position',[30,3029,90,3059]);
    add_block('built-in/Constant','F16_gnc/F16_gnc/const_138','ShowName','off','Value','-21.5','Position',[30,3079,90,3109]);
    add_block('built-in/Constant','F16_gnc/F16_gnc/const_141','ShowName','off','Value','-30.','Position',[30,3129,90,3159]);
    add_block('built-in/Constant','F16_gnc/F16_gnc/const_143','ShowName','off','Value','0.008','Position',[30,3179,90,3209]);
    add_block('built-in/Constant','F16_gnc/F16_gnc/const_145','ShowName','off','Value','100.','Position',[30,3229,90,3259]);
    add_block('built-in/Inport','F16_gnc/F16_gnc/pilotControl_throttle','Position',[45,3295,75,3309]);
    add_block('built-in/Saturate','F16_gnc/F16_gnc/pilotControl_throttle_unlim_limiter','ShowName','off','LowerLimit','0.0','UpperLimit','1.0','AttributesFormatString','%<LowerLimit> to %<UpperLimit>','Position',[130,3279,160,3309]);
    add_block('built-in/Inport','F16_gnc/F16_gnc/pilotControl_long','Position',[45,3345,75,3359]);
    add_block('built-in/Saturate','F16_gnc/F16_gnc/pilotControl_long_unlim_limiter','ShowName','off','LowerLimit','-1.0','UpperLimit','1.0','AttributesFormatString','%<LowerLimit> to %<UpperLimit>','Position',[130,3329,160,3359]);
    add_block('built-in/Inport','F16_gnc/F16_gnc/pilotControl_lat','Position',[45,3395,75,3409]);
    add_block('built-in/Saturate','F16_gnc/F16_gnc/pilotControl_lat_unlim_limiter','ShowName','off','LowerLimit','-1.0','UpperLimit','1.0','AttributesFormatString','%<LowerLimit> to %<UpperLimit>','Position',[130,3379,160,3409]);
    add_block('built-in/Inport','F16_gnc/F16_gnc/pilotControl_yaw','Position',[45,3445,75,3459]);
    add_block('built-in/Saturate','F16_gnc/F16_gnc/pilotControl_yaw_unlim_limiter','ShowName','off','LowerLimit','-1.0','UpperLimit','1.0','AttributesFormatString','%<LowerLimit> to %<UpperLimit>','Position',[130,3429,160,3459]);
    add_block('built-in/Inport','F16_gnc/F16_gnc/stabilityAugmentationOn_disc','Position',[45,3499,75,3513]);
    add_block('built-in/Sum','F16_gnc/F16_gnc/plus_1','IconShape','rectangular','Inputs','++','Position',[130,3479,160,3518]);
    add_block('built-in/Inport','F16_gnc/F16_gnc/autopilotOn_disc','Position',[45,3546,75,3560]);
    add_block('built-in/Inport','F16_gnc/F16_gnc/selectCircumnavigator_disc','Position',[45,3580,75,3594]);
    add_block('built-in/Inport','F16_gnc/F16_gnc/geLatitude','Position',[45,3614,75,3628]);
    add_block('built-in/Inport','F16_gnc/F16_gnc/geLongitude','Position',[45,3648,75,3662]);
    add_block('built-in/Inport','F16_gnc/F16_gnc/equivalentAirspeedCommand','Position',[45,3682,75,3696]);
    add_block('built-in/Inport','F16_gnc/F16_gnc/altitudeMslCommand','Position',[45,3728,75,3742]);
    add_block('built-in/Sum','F16_gnc/F16_gnc/minus_2','IconShape','rectangular','Inputs','+-','Position',[130,3708,160,3747]);
    add_block('built-in/Product','F16_gnc/F16_gnc/times_3','Multiplication','Element-wise(.*)','SaturateOnIntegerOverflow','on','Inputs','2','Position',[200,3708,230,3747]);
    add_block('built-in/Saturate','F16_gnc/F16_gnc/autopilotDeltaPitchCmd_unlim_limiter','ShowName','off','LowerLimit','-5.0','UpperLimit','5.0','AttributesFormatString','%<LowerLimit> to %<UpperLimit>','Position',[270,3712,300,3742]);
    add_block('built-in/Sum','F16_gnc/F16_gnc/plus_4','IconShape','rectangular','Inputs','++','Position',[340,3708,370,3747]);
    add_block('built-in/Inport','F16_gnc/F16_gnc/altitudeMsl','Position',[45,3775,75,3789]);
    add_block('built-in/Inport','F16_gnc/F16_gnc/equivalentAirspeed','Position',[45,3809,75,3823]);
    add_block('built-in/Inport','F16_gnc/F16_gnc/angleOfAttack','Position',[45,3855,75,3869]);
    add_block('built-in/Sum','F16_gnc/F16_gnc/minus_73','IconShape','rectangular','Inputs','+-','Position',[130,3835,160,3874]);
    add_block('built-in/Product','F16_gnc/F16_gnc/times_79','Multiplication','Element-wise(.*)','SaturateOnIntegerOverflow','on','Inputs','2','Position',[200,3835,230,3874]);
    add_block('built-in/Product','F16_gnc/F16_gnc/times_85','Multiplication','Element-wise(.*)','SaturateOnIntegerOverflow','on','Inputs','2','Position',[200,3894,230,3933]);
    add_block('built-in/Inport','F16_gnc/F16_gnc/angleOfSideslip','Position',[45,3973,75,3987]);
    add_block('built-in/Sum','F16_gnc/F16_gnc/plus_46','IconShape','rectangular','Inputs','++','Position',[130,3953,160,3992]);
    add_block('built-in/Product','F16_gnc/F16_gnc/times_91','Multiplication','Element-wise(.*)','SaturateOnIntegerOverflow','on','Inputs','2','Position',[130,4012,160,4051]);
    add_block('built-in/Product','F16_gnc/F16_gnc/times_97','Multiplication','Element-wise(.*)','SaturateOnIntegerOverflow','on','Inputs','2','Position',[130,4071,160,4110]);
    add_block('built-in/Inport','F16_gnc/F16_gnc/eulerAngle_Roll','Position',[45,4138,75,4152]);
    add_block('built-in/Inport','F16_gnc/F16_gnc/eulerAngle_Pitch','Position',[45,4172,75,4186]);
    add_block('built-in/Inport','F16_gnc/F16_gnc/eulerAngle_Yaw','Position',[45,4206,75,4220]);
    add_block('built-in/Inport','F16_gnc/F16_gnc/bodyAngularRate_Roll','Position',[45,4252,75,4266]);
    add_block('built-in/Product','F16_gnc/F16_gnc/times_92','Multiplication','Element-wise(.*)','SaturateOnIntegerOverflow','on','Inputs','2','Position',[130,4232,160,4271]);
    add_block('built-in/Product','F16_gnc/F16_gnc/times_98','Multiplication','Element-wise(.*)','SaturateOnIntegerOverflow','on','Inputs','2','Position',[130,4291,160,4330]);
    add_block('built-in/Inport','F16_gnc/F16_gnc/bodyAngularRate_Pitch','Position',[45,4370,75,4384]);
    add_block('built-in/Product','F16_gnc/F16_gnc/times_80','Multiplication','Element-wise(.*)','SaturateOnIntegerOverflow','on','Inputs','2','Position',[130,4350,160,4389]);
    add_block('built-in/Product','F16_gnc/F16_gnc/times_86','Multiplication','Element-wise(.*)','SaturateOnIntegerOverflow','on','Inputs','2','Position',[130,4409,160,4448]);
    add_block('built-in/Inport','F16_gnc/F16_gnc/bodyAngularRate_Yaw','Position',[45,4488,75,4502]);
    add_block('built-in/Product','F16_gnc/F16_gnc/times_93','Multiplication','Element-wise(.*)','SaturateOnIntegerOverflow','on','Inputs','2','Position',[130,4468,160,4507]);
    add_block('built-in/Product','F16_gnc/F16_gnc/times_99','Multiplication','Element-wise(.*)','SaturateOnIntegerOverflow','on','Inputs','2','Position',[130,4527,160,4566]);
    add_block('built-in/Inport','F16_gnc/F16_gnc/trimmedPilotControl_throttle','Position',[45,4594,75,4608]);
    add_block('built-in/Inport','F16_gnc/F16_gnc/trimmedPilotControl_long','Position',[45,4628,75,4642]);
    add_block('built-in/Constant','F16_gnc/F16_gnc/const_173','ShowName','off','Value','-0.05','Position',[30,4654,90,4684]);
    add_block('built-in/Constant','F16_gnc/F16_gnc/const_175','ShowName','off','Value','90.0','Position',[30,4704,90,4734]);
    add_block('built-in/Constant','F16_gnc/F16_gnc/const_176','ShowName','off','Value','-0.01','Position',[30,4754,90,4784]);
    add_block('built-in/Constant','F16_gnc/F16_gnc/const_177','ShowName','off','Value','-10','Position',[30,4804,90,4834]);
    add_block('built-in/Constant','F16_gnc/F16_gnc/const_180','ShowName','off','Value','2.653813535191715','Position',[30,4854,90,4884]);
    add_block('built-in/Constant','F16_gnc/F16_gnc/const_181','ShowName','off','Value','2.653813535191715','Position',[30,4904,90,4934]);
    add_block('built-in/Constant','F16_gnc/F16_gnc/const_182','ShowName','off','Value','2.878088596053291e+02','Position',[30,4954,90,4984]);
    add_block('built-in/Constant','F16_gnc/F16_gnc/const_183','ShowName','off','Value','-0.063009074230494','Position',[30,5004,90,5034]);
    add_block('built-in/Constant','F16_gnc/F16_gnc/const_184','ShowName','off','Value','0.113230403179271','Position',[30,5054,90,5084]);
    add_block('built-in/Constant','F16_gnc/F16_gnc/const_185','ShowName','off','Value','10.113432224566077','Position',[30,5104,90,5134]);
    add_block('built-in/Constant','F16_gnc/F16_gnc/const_186','ShowName','off','Value','3.154983341632913','Position',[30,5154,90,5184]);
    add_block('built-in/Constant','F16_gnc/F16_gnc/const_187','ShowName','off','Value','0.997260602961658','Position',[30,5204,90,5234]);
    add_block('built-in/Constant','F16_gnc/F16_gnc/const_188','ShowName','off','Value','-0.025467711176391','Position',[30,5254,90,5284]);
    add_block('built-in/Constant','F16_gnc/F16_gnc/const_189','ShowName','off','Value','1.213308488207827','Position',[30,5304,90,5334]);
    add_block('built-in/Constant','F16_gnc/F16_gnc/const_190','ShowName','off','Value','0.208744369535208','Position',[30,5354,90,5384]);
    add_block('built-in/Constant','F16_gnc/F16_gnc/const_191','ShowName','off','Value','3.078043941515770','Position',[30,5404,90,5434]);
    add_block('built-in/Constant','F16_gnc/F16_gnc/const_192','ShowName','off','Value','0.032365863044163','Position',[30,5454,90,5484]);
    add_block('built-in/Constant','F16_gnc/F16_gnc/const_193','ShowName','off','Value','4.557858908828332','Position',[30,5504,90,5534]);
    add_block('built-in/Constant','F16_gnc/F16_gnc/const_194','ShowName','off','Value','0.589443156647647','Position',[30,5554,90,5584]);
    add_block('built-in/Constant','F16_gnc/F16_gnc/const_195','ShowName','off','Value','-0.705817452754520','Position',[30,5604,90,5634]);
    add_block('built-in/Constant','F16_gnc/F16_gnc/const_196','ShowName','off','Value','-0.256362860634868','Position',[30,5654,90,5684]);
    add_block('built-in/Constant','F16_gnc/F16_gnc/const_197','ShowName','off','Value','-1.073666149713151','Position',[30,5704,90,5734]);
    add_block('built-in/Constant','F16_gnc/F16_gnc/const_198','ShowName','off','Value','0.822114635953878','Position',[30,5754,90,5784]);
    h=add_line('F16_gnc/F16_gnc','pilotControl_throttle/1','pilotControl_throttle_unlim_limiter/1','autorouting','on');
    set_param(h,'Name','pilotControl_throttle_unlim');
    h=add_line('F16_gnc/F16_gnc','pilotControl_long/1','pilotControl_long_unlim_limiter/1','autorouting','on');
    set_param(h,'Name','pilotControl_long_unlim');
    h=add_line('F16_gnc/F16_gnc','pilotControl_lat/1','pilotControl_lat_unlim_limiter/1','autorouting','on');
    set_param(h,'Name','pilotControl_lat_unlim');
    h=add_line('F16_gnc/F16_gnc','pilotControl_yaw/1','pilotControl_yaw_unlim_limiter/1','autorouting','on');
    set_param(h,'Name','pilotControl_yaw_unlim');
    h=add_line('F16_gnc/F16_gnc','stabilityAugmentationOn_disc/1','plus_1/1','autorouting','on');
    set_param(h,'Name','stabilityAugmentationOn_disc');
    h=add_line('F16_gnc/F16_gnc','autopilotOn_disc/1','plus_1/2','autorouting','on');
    set_param(h,'Name','autopilotOn_disc');
    h=add_line('F16_gnc/F16_gnc','autopilotOn_disc/1','gt_63/1','autorouting','on');
    set_param(h,'Name','autopilotOn_disc');
    h=add_line('F16_gnc/F16_gnc','autopilotOn_disc/1','gt_66/1','autorouting','on');
    set_param(h,'Name','autopilotOn_disc');
    h=add_line('F16_gnc/F16_gnc','autopilotOn_disc/1','gt_69/1','autorouting','on');
    set_param(h,'Name','autopilotOn_disc');
    h=add_line('F16_gnc/F16_gnc','autopilotOn_disc/1','lt_117/1','autorouting','on');
    set_param(h,'Name','autopilotOn_disc');
    h=add_line('F16_gnc/F16_gnc','autopilotOn_disc/1','lt_121/1','autorouting','on');
    set_param(h,'Name','autopilotOn_disc');
    h=add_line('F16_gnc/F16_gnc','autopilotOn_disc/1','lt_125/1','autorouting','on');
    set_param(h,'Name','autopilotOn_disc');
    h=add_line('F16_gnc/F16_gnc','autopilotOn_disc/1','lt_129/1','autorouting','on');
    set_param(h,'Name','autopilotOn_disc');
    h=add_line('F16_gnc/F16_gnc','selectCircumnavigator_disc/1','gt_41/1','autorouting','on');
    set_param(h,'Name','selectCircumnavigator_disc');
    h=add_line('F16_gnc/F16_gnc','selectCircumnavigator_disc/1','gt_44/1','autorouting','on');
    set_param(h,'Name','selectCircumnavigator_disc');
    h=add_line('F16_gnc/F16_gnc','geLatitude/1','minus_13/2','autorouting','on');
    set_param(h,'Name','geLatitude');
    h=add_line('F16_gnc/F16_gnc','geLatitude/1','times_22/1','autorouting','on');
    set_param(h,'Name','geLatitude');
    h=add_line('F16_gnc/F16_gnc','geLatitude/1','times_25/1','autorouting','on');
    set_param(h,'Name','geLatitude');
    h=add_line('F16_gnc/F16_gnc','geLongitude/1','minus_16/1','autorouting','on');
    set_param(h,'Name','geLongitude');
    h=add_line('F16_gnc/F16_gnc','geLongitude/1','gt_18/1','autorouting','on');
    set_param(h,'Name','geLongitude');
    h=add_line('F16_gnc/F16_gnc','geLongitude/1','plus_20/1','autorouting','on');
    set_param(h,'Name','geLongitude');
    h=add_line('F16_gnc/F16_gnc','equivalentAirspeedCommand/1','switch_62/1','autorouting','on');
    set_param(h,'Name','equivalentAirspeedCommand');
    h=add_line('F16_gnc/F16_gnc','altitudeMslCommand/1','minus_2/2','autorouting','on');
    set_param(h,'Name','altitudeMslCommand');
    h=add_line('F16_gnc/F16_gnc','altitudeMsl/1','minus_2/1','autorouting','on');
    set_param(h,'Name','altitudeMsl');
    h=add_line('F16_gnc/F16_gnc','equivalentAirspeed/1','minus_72/1','autorouting','on');
    set_param(h,'Name','equivalentAirspeed');
    h=add_line('F16_gnc/F16_gnc','angleOfAttack/1','minus_73/1','autorouting','on');
    set_param(h,'Name','angleOfAttack');
    h=add_line('F16_gnc/F16_gnc','angleOfSideslip/1','plus_46/1','autorouting','on');
    set_param(h,'Name','angleOfSideslip');
    h=add_line('F16_gnc/F16_gnc','angleOfSideslip/1','times_91/2','autorouting','on');
    set_param(h,'Name','angleOfSideslip');
    h=add_line('F16_gnc/F16_gnc','angleOfSideslip/1','times_97/2','autorouting','on');
    set_param(h,'Name','angleOfSideslip');
    h=add_line('F16_gnc/F16_gnc','eulerAngle_Roll/1','minus_74/1','autorouting','on');
    set_param(h,'Name','eulerAngle_Roll');
    h=add_line('F16_gnc/F16_gnc','eulerAngle_Pitch/1','minus_75/1','autorouting','on');
    set_param(h,'Name','eulerAngle_Pitch');
    h=add_line('F16_gnc/F16_gnc','eulerAngle_Yaw/1','plus_46/2','autorouting','on');
    set_param(h,'Name','eulerAngle_Yaw');
    h=add_line('F16_gnc/F16_gnc','bodyAngularRate_Roll/1','times_92/2','autorouting','on');
    set_param(h,'Name','bodyAngularRate_Roll');
    h=add_line('F16_gnc/F16_gnc','bodyAngularRate_Roll/1','times_98/2','autorouting','on');
    set_param(h,'Name','bodyAngularRate_Roll');
    h=add_line('F16_gnc/F16_gnc','bodyAngularRate_Pitch/1','times_80/2','autorouting','on');
    set_param(h,'Name','bodyAngularRate_Pitch');
    h=add_line('F16_gnc/F16_gnc','bodyAngularRate_Pitch/1','times_86/2','autorouting','on');
    set_param(h,'Name','bodyAngularRate_Pitch');
    h=add_line('F16_gnc/F16_gnc','bodyAngularRate_Yaw/1','times_93/2','autorouting','on');
    set_param(h,'Name','bodyAngularRate_Yaw');
    h=add_line('F16_gnc/F16_gnc','bodyAngularRate_Yaw/1','times_99/2','autorouting','on');
    set_param(h,'Name','bodyAngularRate_Yaw');
    h=add_line('F16_gnc/F16_gnc','trimmedPilotControl_throttle/1','plus_135/1','autorouting','on');
    set_param(h,'Name','trimmedPilotControl_throttle');
    h=add_line('F16_gnc/F16_gnc','trimmedPilotControl_long/1','plus_132/1','autorouting','on');
    set_param(h,'Name','trimmedPilotControl_long');
    h=add_line('F16_gnc/F16_gnc','plus_1/1','gt_101/1','autorouting','on');
    set_param(h,'Name','forceStabAugOn_disc');
    h=add_line('F16_gnc/F16_gnc','plus_1/1','gt_105/1','autorouting','on');
    set_param(h,'Name','forceStabAugOn_disc');
    h=add_line('F16_gnc/F16_gnc','plus_1/1','gt_109/1','autorouting','on');
    set_param(h,'Name','forceStabAugOn_disc');
    h=add_line('F16_gnc/F16_gnc','plus_1/1','gt_113/1','autorouting','on');
    set_param(h,'Name','forceStabAugOn_disc');
    h=add_line('F16_gnc/F16_gnc','const_173/1','times_3/2','autorouting','on');
    set_param(h,'Name','autopilotAltErrorFeedbackGain');
    h=add_line('F16_gnc/F16_gnc','minus_2/1','times_3/1','autorouting','on');
    set_param(h,'Name','autopilotAltitudeError');
    h=add_line('F16_gnc/F16_gnc','times_3/1','autopilotDeltaPitchCmd_unlim_limiter/1','autorouting','on');
    set_param(h,'Name','autopilotDeltaPitchCmd_unlim');
    h=add_line('F16_gnc/F16_gnc','plus_4/1','switch_65/1','autorouting','on');
    set_param(h,'Name','autopilotPitchCmd');
    h=add_line('F16_gnc/F16_gnc','times_5/1','times_12/1','autorouting','on');
    set_param(h,'Name','deg_to_ft');
    h=add_line('F16_gnc/F16_gnc','times_5/1','times_22/2','autorouting','on');
    set_param(h,'Name','deg_to_ft');
    h=add_line('F16_gnc/F16_gnc','times_5/1','times_23/2','autorouting','on');
    set_param(h,'Name','deg_to_ft');
    h=add_line('F16_gnc/F16_gnc','const_5/1','times_5/1','autorouting','on');
    set_param(h,'Name','const_5');
    h=add_line('F16_gnc/F16_gnc','const_6/1','times_5/2','autorouting','on');
    set_param(h,'Name','const_6');
    h=add_line('F16_gnc/F16_gnc','times_8/1','minus_11/2','autorouting','on');
    set_param(h,'Name','circleRadius_ft');
    h=add_line('F16_gnc/F16_gnc','times_8/1','minus_39/2','autorouting','on');
    set_param(h,'Name','circleRadius_ft');
    h=add_line('F16_gnc/F16_gnc','const_8/1','times_8/1','autorouting','on');
    set_param(h,'Name','const_8');
    h=add_line('F16_gnc/F16_gnc','const_9/1','times_8/2','autorouting','on');
    set_param(h,'Name','const_9');
    h=add_line('F16_gnc/F16_gnc','minus_11/1','switch_40/1','autorouting','on');
    set_param(h,'Name','lateralDeviationErrorPolar');
    h=add_line('F16_gnc/F16_gnc','times_12/1','minus_11/1','autorouting','on');
    set_param(h,'Name','unnamed');
    h=add_line('F16_gnc/F16_gnc','minus_13/1','times_12/2','autorouting','on');
    set_param(h,'Name','unnamed');
    h=add_line('F16_gnc/F16_gnc','const_13/1','minus_13/1','autorouting','on');
    set_param(h,'Name','const_13');
    h=add_line('F16_gnc/F16_gnc','const_175/1','switch_43/1','autorouting','on');
    set_param(h,'Name','trueBaseCourseCommandPolar');
    h=add_line('F16_gnc/F16_gnc','switch_15/1','times_23/1','autorouting','on');
    set_param(h,'Name','degEFromTgt');
    h=add_line('F16_gnc/F16_gnc','minus_16/1','switch_15/1','autorouting','on');
    set_param(h,'Name','unnamed');
    h=add_line('F16_gnc/F16_gnc','const_16/1','minus_16/2','autorouting','on');
    set_param(h,'Name','const_16');
    h=add_line('F16_gnc/F16_gnc','gt_18/1','switch_15/2','autorouting','on');
    set_param(h,'Name','unnamed');
    h=add_line('F16_gnc/F16_gnc','const_18/1','gt_18/2','autorouting','on');
    set_param(h,'Name','const_18');
    h=add_line('F16_gnc/F16_gnc','plus_20/1','switch_15/3','autorouting','on');
    set_param(h,'Name','unnamed');
    h=add_line('F16_gnc/F16_gnc','const_20/1','plus_20/2','autorouting','on');
    set_param(h,'Name','const_20');
    h=add_line('F16_gnc/F16_gnc','times_22/1','times_32/1','autorouting','on');
    set_param(h,'Name','ftNFromTgt');
    h=add_line('F16_gnc/F16_gnc','times_22/1','times_32/2','autorouting','on');
    set_param(h,'Name','ftNFromTgt');
    h=add_line('F16_gnc/F16_gnc','times_22/1','atan2_36/1','autorouting','on');
    set_param(h,'Name','ftNFromTgt');
    h=add_line('F16_gnc/F16_gnc','times_23/1','times_31/1','autorouting','on');
    set_param(h,'Name','ftEFromTgt');
    h=add_line('F16_gnc/F16_gnc','times_23/1','times_31/2','autorouting','on');
    set_param(h,'Name','ftEFromTgt');
    h=add_line('F16_gnc/F16_gnc','times_23/1','atan2_36/2','autorouting','on');
    set_param(h,'Name','ftEFromTgt');
    h=add_line('F16_gnc/F16_gnc','cos_24/1','times_23/3','autorouting','on');
    set_param(h,'Name','unnamed');
    h=add_line('F16_gnc/F16_gnc','times_25/1','cos_24/1','autorouting','on');
    set_param(h,'Name','unnamed');
    h=add_line('F16_gnc/F16_gnc','divide_26/1','times_25/2','autorouting','on');
    set_param(h,'Name','unnamed');
    h=add_line('F16_gnc/F16_gnc','const_26/1','divide_26/1','autorouting','on');
    set_param(h,'Name','const_26');
    h=add_line('F16_gnc/F16_gnc','const_27/1','divide_26/2','autorouting','on');
    set_param(h,'Name','const_27');
    h=add_line('F16_gnc/F16_gnc','power_29/1','minus_39/1','autorouting','on');
    set_param(h,'Name','radiusFromTgt');
    h=add_line('F16_gnc/F16_gnc','plus_30/1','power_29/1','autorouting','on');
    set_param(h,'Name','unnamed');
    h=add_line('F16_gnc/F16_gnc','times_31/1','plus_30/1','autorouting','on');
    set_param(h,'Name','unnamed');
    h=add_line('F16_gnc/F16_gnc','times_32/1','plus_30/2','autorouting','on');
    set_param(h,'Name','unnamed');
    h=add_line('F16_gnc/F16_gnc','const_32/1','power_29/2','autorouting','on');
    set_param(h,'Name','const_32');
    h=add_line('F16_gnc/F16_gnc','divide_34/1','switch_43/3','autorouting','on');
    set_param(h,'Name','trueBaseCourseCommandEquatorIDL');
    h=add_line('F16_gnc/F16_gnc','times_35/1','divide_34/1','autorouting','on');
    set_param(h,'Name','unnamed');
    h=add_line('F16_gnc/F16_gnc','atan2_36/1','times_35/1','autorouting','on');
    set_param(h,'Name','unnamed');
    h=add_line('F16_gnc/F16_gnc','const_36/1','times_35/2','autorouting','on');
    set_param(h,'Name','const_36');
    h=add_line('F16_gnc/F16_gnc','const_37/1','divide_34/2','autorouting','on');
    set_param(h,'Name','const_37');
    h=add_line('F16_gnc/F16_gnc','minus_39/1','switch_40/3','autorouting','on');
    set_param(h,'Name','lateralDeviationErrorEquatorIDL');
    h=add_line('F16_gnc/F16_gnc','switch_40/1','times_47/2','autorouting','on');
    set_param(h,'Name','lateralDeviation');
    h=add_line('F16_gnc/F16_gnc','gt_41/1','switch_40/2','autorouting','on');
    set_param(h,'Name','unnamed');
    h=add_line('F16_gnc/F16_gnc','const_41/1','gt_41/2','autorouting','on');
    set_param(h,'Name','const_41');
    h=add_line('F16_gnc/F16_gnc','switch_43/1','plus_48/2','autorouting','on');
    set_param(h,'Name','trueBaseCourseCommand');
    h=add_line('F16_gnc/F16_gnc','gt_44/1','switch_43/2','autorouting','on');
    set_param(h,'Name','unnamed');
    h=add_line('F16_gnc/F16_gnc','const_44/1','gt_44/2','autorouting','on');
    set_param(h,'Name','const_44');
    h=add_line('F16_gnc/F16_gnc','plus_46/1','minus_49/1','autorouting','on');
    set_param(h,'Name','trackAngleEst');
    h=add_line('F16_gnc/F16_gnc','const_176/1','times_47/1','autorouting','on');
    set_param(h,'Name','autopilotLatOffsetErrorFeedbackGain');
    h=add_line('F16_gnc/F16_gnc','const_177/1','times_61/1','autorouting','on');
    set_param(h,'Name','autopilotTrackErrorFeedbackGain');
    h=add_line('F16_gnc/F16_gnc','times_47/1','autopilotCourseCorrection_unlim_limiter/1','autorouting','on');
    set_param(h,'Name','autopilotCourseCorrection_unlim');
    h=add_line('F16_gnc/F16_gnc','plus_48/1','minus_49/2','autorouting','on');
    set_param(h,'Name','autopilotCourseCommand');
    h=add_line('F16_gnc/F16_gnc','minus_49/1','switch_50/3','autorouting','on');
    set_param(h,'Name','autopilotTrackError');
    h=add_line('F16_gnc/F16_gnc','minus_49/1','minus_52/1','autorouting','on');
    set_param(h,'Name','autopilotTrackError');
    h=add_line('F16_gnc/F16_gnc','minus_49/1','gt_54/1','autorouting','on');
    set_param(h,'Name','autopilotTrackError');
    h=add_line('F16_gnc/F16_gnc','minus_49/1','plus_56/1','autorouting','on');
    set_param(h,'Name','autopilotTrackError');
    h=add_line('F16_gnc/F16_gnc','minus_49/1','abs_59/1','autorouting','on');
    set_param(h,'Name','autopilotTrackError');
    h=add_line('F16_gnc/F16_gnc','switch_50/1','times_61/2','autorouting','on');
    set_param(h,'Name','autopilotTrackErrorWrapped');
    h=add_line('F16_gnc/F16_gnc','switch_51/1','switch_50/1','autorouting','on');
    set_param(h,'Name','unnamed');
    h=add_line('F16_gnc/F16_gnc','minus_52/1','switch_51/1','autorouting','on');
    set_param(h,'Name','unnamed');
    h=add_line('F16_gnc/F16_gnc','const_52/1','minus_52/2','autorouting','on');
    set_param(h,'Name','const_52');
    h=add_line('F16_gnc/F16_gnc','gt_54/1','switch_51/2','autorouting','on');
    set_param(h,'Name','unnamed');
    h=add_line('F16_gnc/F16_gnc','const_54/1','gt_54/2','autorouting','on');
    set_param(h,'Name','const_54');
    h=add_line('F16_gnc/F16_gnc','plus_56/1','switch_51/3','autorouting','on');
    set_param(h,'Name','unnamed');
    h=add_line('F16_gnc/F16_gnc','const_56/1','plus_56/2','autorouting','on');
    set_param(h,'Name','const_56');
    h=add_line('F16_gnc/F16_gnc','gt_58/1','switch_50/2','autorouting','on');
    set_param(h,'Name','unnamed');
    h=add_line('F16_gnc/F16_gnc','abs_59/1','gt_58/1','autorouting','on');
    set_param(h,'Name','unnamed');
    h=add_line('F16_gnc/F16_gnc','const_59/1','gt_58/2','autorouting','on');
    set_param(h,'Name','const_59');
    h=add_line('F16_gnc/F16_gnc','times_61/1','autopilotCommandedBankAngle_unlim_limiter/1','autorouting','on');
    set_param(h,'Name','autopilotCommandedBankAngle_unlim');
    h=add_line('F16_gnc/F16_gnc','const_180/1','minus_73/2','autorouting','on');
    set_param(h,'Name','designAngleOfAttack');
    h=add_line('F16_gnc/F16_gnc','const_181/1','plus_4/2','autorouting','on');
    set_param(h,'Name','designEulerAngle_Pitch');
    h=add_line('F16_gnc/F16_gnc','const_181/1','switch_65/3','autorouting','on');
    set_param(h,'Name','designEulerAngle_Pitch');
    h=add_line('F16_gnc/F16_gnc','const_182/1','switch_62/3','autorouting','on');
    set_param(h,'Name','designEquivalentAirspeed');
    h=add_line('F16_gnc/F16_gnc','switch_62/1','minus_72/2','autorouting','on');
    set_param(h,'Name','switchedKEAScmd');
    h=add_line('F16_gnc/F16_gnc','gt_63/1','switch_62/2','autorouting','on');
    set_param(h,'Name','unnamed');
    h=add_line('F16_gnc/F16_gnc','const_63/1','gt_63/2','autorouting','on');
    set_param(h,'Name','const_63');
    h=add_line('F16_gnc/F16_gnc','switch_65/1','minus_75/2','autorouting','on');
    set_param(h,'Name','switchedThetaCmd');
    h=add_line('F16_gnc/F16_gnc','gt_66/1','switch_65/2','autorouting','on');
    set_param(h,'Name','unnamed');
    h=add_line('F16_gnc/F16_gnc','const_66/1','gt_66/2','autorouting','on');
    set_param(h,'Name','const_66');
    h=add_line('F16_gnc/F16_gnc','switch_68/1','minus_74/2','autorouting','on');
    set_param(h,'Name','switchedPhiCmd');
    h=add_line('F16_gnc/F16_gnc','gt_69/1','switch_68/2','autorouting','on');
    set_param(h,'Name','unnamed');
    h=add_line('F16_gnc/F16_gnc','const_69/1','gt_69/2','autorouting','on');
    set_param(h,'Name','const_69');
    h=add_line('F16_gnc/F16_gnc','const_70/1','switch_68/3','autorouting','on');
    set_param(h,'Name','const_70');
    h=add_line('F16_gnc/F16_gnc','const_183/1','times_78/1','autorouting','on');
    set_param(h,'Name','longLQR_gain_matrix_11');
    h=add_line('F16_gnc/F16_gnc','const_184/1','times_79/1','autorouting','on');
    set_param(h,'Name','longLQR_gain_matrix_12');
    h=add_line('F16_gnc/F16_gnc','const_185/1','times_80/1','autorouting','on');
    set_param(h,'Name','longLQR_gain_matrix_13');
    h=add_line('F16_gnc/F16_gnc','const_186/1','times_81/1','autorouting','on');
    set_param(h,'Name','longLQR_gain_matrix_14');
    h=add_line('F16_gnc/F16_gnc','const_187/1','times_84/1','autorouting','on');
    set_param(h,'Name','longLQR_gain_matrix_21');
    h=add_line('F16_gnc/F16_gnc','const_188/1','times_85/1','autorouting','on');
    set_param(h,'Name','longLQR_gain_matrix_22');
    h=add_line('F16_gnc/F16_gnc','const_189/1','times_86/1','autorouting','on');
    set_param(h,'Name','longLQR_gain_matrix_23');
    h=add_line('F16_gnc/F16_gnc','const_190/1','times_87/1','autorouting','on');
    set_param(h,'Name','longLQR_gain_matrix_24');
    h=add_line('F16_gnc/F16_gnc','const_191/1','times_90/1','autorouting','on');
    set_param(h,'Name','latdLQR_gain_matrix_11');
    h=add_line('F16_gnc/F16_gnc','const_192/1','times_91/1','autorouting','on');
    set_param(h,'Name','latdLQR_gain_matrix_12');
    h=add_line('F16_gnc/F16_gnc','const_193/1','times_92/1','autorouting','on');
    set_param(h,'Name','latdLQR_gain_matrix_13');
    h=add_line('F16_gnc/F16_gnc','const_194/1','times_93/1','autorouting','on');
    set_param(h,'Name','latdLQR_gain_matrix_14');
    h=add_line('F16_gnc/F16_gnc','const_195/1','times_96/1','autorouting','on');
    set_param(h,'Name','latdLQR_gain_matrix_21');
    h=add_line('F16_gnc/F16_gnc','const_196/1','times_97/1','autorouting','on');
    set_param(h,'Name','latdLQR_gain_matrix_22');
    h=add_line('F16_gnc/F16_gnc','const_197/1','times_98/1','autorouting','on');
    set_param(h,'Name','latdLQR_gain_matrix_23');
    h=add_line('F16_gnc/F16_gnc','const_198/1','times_99/1','autorouting','on');
    set_param(h,'Name','latdLQR_gain_matrix_24');
    h=add_line('F16_gnc/F16_gnc','minus_72/1','times_78/2','autorouting','on');
    set_param(h,'Name','disturbedEquivalentAirspeed');
    h=add_line('F16_gnc/F16_gnc','minus_72/1','times_84/2','autorouting','on');
    set_param(h,'Name','disturbedEquivalentAirspeed');
    h=add_line('F16_gnc/F16_gnc','minus_73/1','times_79/2','autorouting','on');
    set_param(h,'Name','disturbedAngleOfAttack');
    h=add_line('F16_gnc/F16_gnc','minus_73/1','times_85/2','autorouting','on');
    set_param(h,'Name','disturbedAngleOfAttack');
    h=add_line('F16_gnc/F16_gnc','minus_74/1','times_90/2','autorouting','on');
    set_param(h,'Name','disturbedEulerAngle_roll');
    h=add_line('F16_gnc/F16_gnc','minus_74/1','times_96/2','autorouting','on');
    set_param(h,'Name','disturbedEulerAngle_roll');
    h=add_line('F16_gnc/F16_gnc','minus_75/1','times_81/2','autorouting','on');
    set_param(h,'Name','disturbedEulerAngle_pitch');
    h=add_line('F16_gnc/F16_gnc','minus_75/1','times_87/2','autorouting','on');
    set_param(h,'Name','disturbedEulerAngle_pitch');
    h=add_line('F16_gnc/F16_gnc','minus_76/1','switch_100/1','autorouting','on');
    set_param(h,'Name','deltaLongLQR');
    h=add_line('F16_gnc/F16_gnc','plus_77/1','minus_76/1','autorouting','on');
    set_param(h,'Name','unnamed');
    h=add_line('F16_gnc/F16_gnc','times_78/1','plus_77/1','autorouting','on');
    set_param(h,'Name','unnamed');
    h=add_line('F16_gnc/F16_gnc','times_79/1','plus_77/2','autorouting','on');
    set_param(h,'Name','unnamed');
    h=add_line('F16_gnc/F16_gnc','times_80/1','plus_77/3','autorouting','on');
    set_param(h,'Name','unnamed');
    h=add_line('F16_gnc/F16_gnc','times_81/1','plus_77/4','autorouting','on');
    set_param(h,'Name','unnamed');
    h=add_line('F16_gnc/F16_gnc','minus_82/1','switch_104/1','autorouting','on');
    set_param(h,'Name','deltaThrottleLQR');
    h=add_line('F16_gnc/F16_gnc','plus_83/1','minus_82/1','autorouting','on');
    set_param(h,'Name','unnamed');
    h=add_line('F16_gnc/F16_gnc','times_84/1','plus_83/1','autorouting','on');
    set_param(h,'Name','unnamed');
    h=add_line('F16_gnc/F16_gnc','times_85/1','plus_83/2','autorouting','on');
    set_param(h,'Name','unnamed');
    h=add_line('F16_gnc/F16_gnc','times_86/1','plus_83/3','autorouting','on');
    set_param(h,'Name','unnamed');
    h=add_line('F16_gnc/F16_gnc','times_87/1','plus_83/4','autorouting','on');
    set_param(h,'Name','unnamed');
    h=add_line('F16_gnc/F16_gnc','minus_88/1','switch_108/1','autorouting','on');
    set_param(h,'Name','deltaLatLQR');
    h=add_line('F16_gnc/F16_gnc','plus_89/1','minus_88/1','autorouting','on');
    set_param(h,'Name','unnamed');
    h=add_line('F16_gnc/F16_gnc','times_90/1','plus_89/1','autorouting','on');
    set_param(h,'Name','unnamed');
    h=add_line('F16_gnc/F16_gnc','times_91/1','plus_89/2','autorouting','on');
    set_param(h,'Name','unnamed');
    h=add_line('F16_gnc/F16_gnc','times_92/1','plus_89/3','autorouting','on');
    set_param(h,'Name','unnamed');
    h=add_line('F16_gnc/F16_gnc','times_93/1','plus_89/4','autorouting','on');
    set_param(h,'Name','unnamed');
    h=add_line('F16_gnc/F16_gnc','minus_94/1','switch_112/1','autorouting','on');
    set_param(h,'Name','deltaDirLQR');
    h=add_line('F16_gnc/F16_gnc','plus_95/1','minus_94/1','autorouting','on');
    set_param(h,'Name','unnamed');
    h=add_line('F16_gnc/F16_gnc','times_96/1','plus_95/1','autorouting','on');
    set_param(h,'Name','unnamed');
    h=add_line('F16_gnc/F16_gnc','times_97/1','plus_95/2','autorouting','on');
    set_param(h,'Name','unnamed');
    h=add_line('F16_gnc/F16_gnc','times_98/1','plus_95/3','autorouting','on');
    set_param(h,'Name','unnamed');
    h=add_line('F16_gnc/F16_gnc','times_99/1','plus_95/4','autorouting','on');
    set_param(h,'Name','unnamed');
    h=add_line('F16_gnc/F16_gnc','switch_100/1','plus_132/3','autorouting','on');
    set_param(h,'Name','switchedDeltaLongLQR');
    h=add_line('F16_gnc/F16_gnc','gt_101/1','switch_100/2','autorouting','on');
    set_param(h,'Name','unnamed');
    h=add_line('F16_gnc/F16_gnc','const_101/1','gt_101/2','autorouting','on');
    set_param(h,'Name','const_101');
    h=add_line('F16_gnc/F16_gnc','const_102/1','switch_100/3','autorouting','on');
    set_param(h,'Name','const_102');
    h=add_line('F16_gnc/F16_gnc','switch_104/1','plus_135/3','autorouting','on');
    set_param(h,'Name','switchedDeltaThrottleLQR');
    h=add_line('F16_gnc/F16_gnc','gt_105/1','switch_104/2','autorouting','on');
    set_param(h,'Name','unnamed');
    h=add_line('F16_gnc/F16_gnc','const_105/1','gt_105/2','autorouting','on');
    set_param(h,'Name','const_105');
    h=add_line('F16_gnc/F16_gnc','const_106/1','switch_104/3','autorouting','on');
    set_param(h,'Name','const_106');
    h=add_line('F16_gnc/F16_gnc','switch_108/1','plus_133/2','autorouting','on');
    set_param(h,'Name','switchedDeltaLatLQR');
    h=add_line('F16_gnc/F16_gnc','gt_109/1','switch_108/2','autorouting','on');
    set_param(h,'Name','unnamed');
    h=add_line('F16_gnc/F16_gnc','const_109/1','gt_109/2','autorouting','on');
    set_param(h,'Name','const_109');
    h=add_line('F16_gnc/F16_gnc','const_110/1','switch_108/3','autorouting','on');
    set_param(h,'Name','const_110');
    h=add_line('F16_gnc/F16_gnc','switch_112/1','plus_134/2','autorouting','on');
    set_param(h,'Name','switchedDeltaDirLQR');
    h=add_line('F16_gnc/F16_gnc','gt_113/1','switch_112/2','autorouting','on');
    set_param(h,'Name','unnamed');
    h=add_line('F16_gnc/F16_gnc','const_113/1','gt_113/2','autorouting','on');
    set_param(h,'Name','const_113');
    h=add_line('F16_gnc/F16_gnc','const_114/1','switch_112/3','autorouting','on');
    set_param(h,'Name','const_114');
    h=add_line('F16_gnc/F16_gnc','switch_116/1','plus_132/2','autorouting','on');
    set_param(h,'Name','switchedPilotControl_long');
    h=add_line('F16_gnc/F16_gnc','lt_117/1','switch_116/2','autorouting','on');
    set_param(h,'Name','unnamed');
    h=add_line('F16_gnc/F16_gnc','const_117/1','lt_117/2','autorouting','on');
    set_param(h,'Name','const_117');
    h=add_line('F16_gnc/F16_gnc','const_118/1','switch_116/3','autorouting','on');
    set_param(h,'Name','const_118');
    h=add_line('F16_gnc/F16_gnc','switch_120/1','plus_135/2','autorouting','on');
    set_param(h,'Name','switchedPilotControl_throttle');
    h=add_line('F16_gnc/F16_gnc','lt_121/1','switch_120/2','autorouting','on');
    set_param(h,'Name','unnamed');
    h=add_line('F16_gnc/F16_gnc','const_121/1','lt_121/2','autorouting','on');
    set_param(h,'Name','const_121');
    h=add_line('F16_gnc/F16_gnc','const_122/1','switch_120/3','autorouting','on');
    set_param(h,'Name','const_122');
    h=add_line('F16_gnc/F16_gnc','switch_124/1','plus_133/1','autorouting','on');
    set_param(h,'Name','switchedPilotControl_lat');
    h=add_line('F16_gnc/F16_gnc','lt_125/1','switch_124/2','autorouting','on');
    set_param(h,'Name','unnamed');
    h=add_line('F16_gnc/F16_gnc','const_125/1','lt_125/2','autorouting','on');
    set_param(h,'Name','const_125');
    h=add_line('F16_gnc/F16_gnc','const_126/1','switch_124/3','autorouting','on');
    set_param(h,'Name','const_126');
    h=add_line('F16_gnc/F16_gnc','switch_128/1','plus_134/1','autorouting','on');
    set_param(h,'Name','switchedPilotControl_yaw');
    h=add_line('F16_gnc/F16_gnc','lt_129/1','switch_128/2','autorouting','on');
    set_param(h,'Name','unnamed');
    h=add_line('F16_gnc/F16_gnc','const_129/1','lt_129/2','autorouting','on');
    set_param(h,'Name','const_129');
    h=add_line('F16_gnc/F16_gnc','const_130/1','switch_128/3','autorouting','on');
    set_param(h,'Name','const_130');
    h=add_line('F16_gnc/F16_gnc','plus_132/1','totalLongCmd_unlim_limiter/1','autorouting','on');
    set_param(h,'Name','totalLongCmd_unlim');
    h=add_line('F16_gnc/F16_gnc','plus_133/1','totalLatCmd_unlim_limiter/1','autorouting','on');
    set_param(h,'Name','totalLatCmd_unlim');
    h=add_line('F16_gnc/F16_gnc','plus_134/1','totalDirCmd_unlim_limiter/1','autorouting','on');
    set_param(h,'Name','totalDirCmd_unlim');
    h=add_line('F16_gnc/F16_gnc','plus_135/1','totalThrottle_unlim_limiter/1','autorouting','on');
    set_param(h,'Name','totalThrottle_unlim');
    h=add_line('F16_gnc/F16_gnc','times_136/1','elevatorDeflection/1','autorouting','on');
    set_param(h,'Name','elevatorDeflection');
    h=add_line('F16_gnc/F16_gnc','const_136/1','times_136/1','autorouting','on');
    set_param(h,'Name','const_136');
    h=add_line('F16_gnc/F16_gnc','times_138/1','times_143/2','autorouting','on');
    set_param(h,'Name','aileronDeflection');
    h=add_line('F16_gnc/F16_gnc','times_138/1','aileronDeflection/1','autorouting','on');
    set_param(h,'Name','aileronDeflection');
    h=add_line('F16_gnc/F16_gnc','const_138/1','times_138/1','autorouting','on');
    set_param(h,'Name','const_138');
    h=add_line('F16_gnc/F16_gnc','plus_140/1','rudderDeflection/1','autorouting','on');
    set_param(h,'Name','rudderDeflection');
    h=add_line('F16_gnc/F16_gnc','times_141/1','plus_140/1','autorouting','on');
    set_param(h,'Name','unnamed');
    h=add_line('F16_gnc/F16_gnc','const_141/1','times_141/1','autorouting','on');
    set_param(h,'Name','const_141');
    h=add_line('F16_gnc/F16_gnc','times_143/1','plus_140/2','autorouting','on');
    set_param(h,'Name','unnamed');
    h=add_line('F16_gnc/F16_gnc','const_143/1','times_143/1','autorouting','on');
    set_param(h,'Name','const_143');
    h=add_line('F16_gnc/F16_gnc','times_145/1','powerLeverAngle/1','autorouting','on');
    set_param(h,'Name','powerLeverAngle');
    h=add_line('F16_gnc/F16_gnc','const_145/1','times_145/1','autorouting','on');
    set_param(h,'Name','const_145');
    h=add_line('F16_gnc/F16_gnc','pilotControl_throttle_unlim_limiter/1','switch_120/1','autorouting','on');
    set_param(h,'Name','pilotControl_throttle');
    h=add_line('F16_gnc/F16_gnc','pilotControl_long_unlim_limiter/1','switch_116/1','autorouting','on');
    set_param(h,'Name','pilotControl_long');
    h=add_line('F16_gnc/F16_gnc','pilotControl_lat_unlim_limiter/1','switch_124/1','autorouting','on');
    set_param(h,'Name','pilotControl_lat');
    h=add_line('F16_gnc/F16_gnc','pilotControl_yaw_unlim_limiter/1','switch_128/1','autorouting','on');
    set_param(h,'Name','pilotControl_yaw');
    h=add_line('F16_gnc/F16_gnc','autopilotDeltaPitchCmd_unlim_limiter/1','plus_4/1','autorouting','on');
    set_param(h,'Name','autopilotDeltaPitchCmd');
    h=add_line('F16_gnc/F16_gnc','autopilotCourseCorrection_unlim_limiter/1','plus_48/1','autorouting','on');
    set_param(h,'Name','autopilotCourseCorrection');
    h=add_line('F16_gnc/F16_gnc','autopilotCommandedBankAngle_unlim_limiter/1','switch_68/1','autorouting','on');
    set_param(h,'Name','autopilotCommandedBankAngle');
    h=add_line('F16_gnc/F16_gnc','totalLongCmd_unlim_limiter/1','times_136/2','autorouting','on');
    set_param(h,'Name','totalLongCmd');
    h=add_line('F16_gnc/F16_gnc','totalLatCmd_unlim_limiter/1','times_138/2','autorouting','on');
    set_param(h,'Name','totalLatCmd');
    h=add_line('F16_gnc/F16_gnc','totalDirCmd_unlim_limiter/1','times_141/2','autorouting','on');
    set_param(h,'Name','totalDirCmd');
    h=add_line('F16_gnc/F16_gnc','totalThrottle_unlim_limiter/1','times_145/2','autorouting','on');
    set_param(h,'Name','totalThrottle');
    
    % Correct output numbers
    
    set_param('F16_gnc/F16_gnc/elevatorDeflection','Port','1');
    set_param('F16_gnc/F16_gnc/aileronDeflection','Port','2');
    set_param('F16_gnc/F16_gnc/rudderDeflection','Port','3');
    set_param('F16_gnc/F16_gnc/powerLeverAngle','Port','4');

% Top-level inports and lines

add_block('built-in/Inport','F16_gnc/pilotControl_throttle','Position',[90, 58, 120, 72]);
add_line('F16_gnc','pilotControl_throttle/1','F16_gnc/1');
add_block('built-in/Inport','F16_gnc/pilotControl_long','Position',[90, 88, 120, 102]);
add_line('F16_gnc','pilotControl_long/1','F16_gnc/2');
add_block('built-in/Inport','F16_gnc/pilotControl_lat','Position',[90, 118, 120, 132]);
add_line('F16_gnc','pilotControl_lat/1','F16_gnc/3');
add_block('built-in/Inport','F16_gnc/pilotControl_yaw','Position',[90, 148, 120, 162]);
add_line('F16_gnc','pilotControl_yaw/1','F16_gnc/4');
add_block('built-in/Inport','F16_gnc/stabilityAugmentationOn_disc','Position',[90, 178, 120, 192]);
add_line('F16_gnc','stabilityAugmentationOn_disc/1','F16_gnc/5');
add_block('built-in/Inport','F16_gnc/autopilotOn_disc','Position',[90, 208, 120, 222]);
add_line('F16_gnc','autopilotOn_disc/1','F16_gnc/6');
add_block('built-in/Inport','F16_gnc/selectCircumnavigator_disc','Position',[90, 238, 120, 252]);
add_line('F16_gnc','selectCircumnavigator_disc/1','F16_gnc/7');
add_block('built-in/Inport','F16_gnc/geLatitude','Position',[90, 268, 120, 282]);
add_line('F16_gnc','geLatitude/1','F16_gnc/8');
add_block('built-in/Inport','F16_gnc/geLongitude','Position',[90, 298, 120, 312]);
add_line('F16_gnc','geLongitude/1','F16_gnc/9');
add_block('built-in/Inport','F16_gnc/equivalentAirspeedCommand','Position',[90, 328, 120, 342]);
add_line('F16_gnc','equivalentAirspeedCommand/1','F16_gnc/10');
add_block('built-in/Inport','F16_gnc/altitudeMslCommand','Position',[90, 358, 120, 372]);
add_line('F16_gnc','altitudeMslCommand/1','F16_gnc/11');
add_block('built-in/Inport','F16_gnc/altitudeMsl','Position',[90, 388, 120, 402]);
add_line('F16_gnc','altitudeMsl/1','F16_gnc/12');
add_block('built-in/Inport','F16_gnc/equivalentAirspeed','Position',[90, 418, 120, 432]);
add_line('F16_gnc','equivalentAirspeed/1','F16_gnc/13');
add_block('built-in/Inport','F16_gnc/angleOfAttack','Position',[90, 448, 120, 462]);
add_line('F16_gnc','angleOfAttack/1','F16_gnc/14');
add_block('built-in/Inport','F16_gnc/angleOfSideslip','Position',[90, 478, 120, 492]);
add_line('F16_gnc','angleOfSideslip/1','F16_gnc/15');
add_block('built-in/Inport','F16_gnc/eulerAngle_Roll','Position',[90, 508, 120, 522]);
add_line('F16_gnc','eulerAngle_Roll/1','F16_gnc/16');
add_block('built-in/Inport','F16_gnc/eulerAngle_Pitch','Position',[90, 538, 120, 552]);
add_line('F16_gnc','eulerAngle_Pitch/1','F16_gnc/17');
add_block('built-in/Inport','F16_gnc/eulerAngle_Yaw','Position',[90, 568, 120, 582]);
add_line('F16_gnc','eulerAngle_Yaw/1','F16_gnc/18');
add_block('built-in/Inport','F16_gnc/bodyAngularRate_Roll','Position',[90, 598, 120, 612]);
add_line('F16_gnc','bodyAngularRate_Roll/1','F16_gnc/19');
add_block('built-in/Inport','F16_gnc/bodyAngularRate_Pitch','Position',[90, 628, 120, 642]);
add_line('F16_gnc','bodyAngularRate_Pitch/1','F16_gnc/20');
add_block('built-in/Inport','F16_gnc/bodyAngularRate_Yaw','Position',[90, 658, 120, 672]);
add_line('F16_gnc','bodyAngularRate_Yaw/1','F16_gnc/21');
add_block('built-in/Inport','F16_gnc/trimmedPilotControl_throttle','Position',[90, 688, 120, 702]);
add_line('F16_gnc','trimmedPilotControl_throttle/1','F16_gnc/22');
add_block('built-in/Inport','F16_gnc/trimmedPilotControl_long','Position',[90, 718, 120, 732]);
add_line('F16_gnc','trimmedPilotControl_long/1','F16_gnc/23');

% Top-level outports and lines

add_block('built-in/Outport','F16_gnc/elevatorDeflection','Position',[480, 93, 510, 107]);
add_line('F16_gnc','F16_gnc/1','elevatorDeflection/1');
add_block('built-in/Outport','F16_gnc/aileronDeflection','Position',[480, 288, 510, 302]);
add_line('F16_gnc','F16_gnc/2','aileronDeflection/1');
add_block('built-in/Outport','F16_gnc/rudderDeflection','Position',[480, 483, 510, 497]);
add_line('F16_gnc','F16_gnc/3','rudderDeflection/1');
add_block('built-in/Outport','F16_gnc/powerLeverAngle','Position',[480, 678, 510, 692]);
add_line('F16_gnc','F16_gnc/4','powerLeverAngle/1');

% Add annotation

add_block('built-in/Note','F16_gnc/Auto-generated by DAVE2SL version 0.9.6 (2013-07-29)','Position',[300, 22]);

clear h;  % remove handle used for naming lines

% Pause so window can be drawn prior to verification

% pause(0.5); - disabled with R2006b/7.3; causes typeahead buffer overflow
if exist('F16_gnc_verify') == 2
  if F16_gnc_verify
    save_system('F16_gnc','F16_gnc');
    fprintf('\n"F16_gnc" model verified and saved.\n')
  else
    fprintf('\n"F16_gnc" model NOT VERIFIED; model has NOT been saved.\n')
  end
else
  save_system('F16_gnc','F16_gnc');
  fprintf('\n"F16_gnc" model saved.\n')
end

% F16_gnc model-building script was auto-generated 
% by DAVE2SL version 0.9.6 (2013-07-29)
% on Tue Oct 22 16:10:08 2013.
