When I generate code from the attached model I receive the following code
54 if (GroupCode_M->Timing.TaskCounters.TID[1] == 0) { 55 /* Gain: '<Root>/TsB' incorporates: 56 * Inport: '<Root>/in1' 57 */ 58 GroupCode_B.TsB = GroupCode_P.TsB_Gain * GroupCode_U.in1; 59 } 60 61 if (GroupCode_M->Timing.TaskCounters.TID[1] == 0) { 62 /* Gain: '<Root>/TsB1' incorporates: 63 * Inport: '<Root>/in1' 64 */ 65 GroupCode_B.TsB1 = GroupCode_P.TsB1_Gain * GroupCode_U.in1; 66 } 67 68 if (GroupCode_M->Timing.TaskCounters.TID[1] == 0) { 69 /* Gain: '<Root>/TsB2' incorporates: 70 * Inport: '<Root>/in1' 71 */ 72 GroupCode_B.TsB2 = GroupCode_P.TsB2_Gain * GroupCode_U.in1; 73 }
Is there a way or an optimization to just have one if statement in this code?
Best Answer