/*
 * Arguments    : const mxArray *prhs[7]
 *                const mxArray *plhs[1]
 * Return Type  : void
 */
void classifyNotes_api(const mxArray *prhs[7], const mxArray *plhs[1])
{
  emxArray_real_T *notes_gt;
  emxArray_real_T *notes_tr;
  struct0_T Results;
  real_T onset_lim;
  real_T dur_percent_range;
  real_T min_dur_dist;
  real_T f0_range_in_cents;
  real_T hopsize;
  emlrtStack st = { NULL, NULL, NULL };

  st.tls = emlrtRootTLSGlobal;
  emlrtHeapReferenceStackEnterFcnR2012b(&st);
  emxInit_real_T(&st, &notes_gt, 2, true);
  emxInit_real_T(&st, &notes_tr, 2, true);
  emxInitStruct_struct0_T(&st, &Results, true);
  prhs[0] = emlrtProtectR2012b(prhs[0], 0, false, -1);
  prhs[1] = emlrtProtectR2012b(prhs[1], 1, false, -1);

  /* Marshall function inputs */
  emlrt_marshallIn(&st, emlrtAlias(prhs[0]), "notes_gt", notes_gt);
  emlrt_marshallIn(&st, emlrtAlias(prhs[1]), "notes_tr", notes_tr);
  onset_lim = c_emlrt_marshallIn(&st, emlrtAliasP(prhs[2]), "onset_lim");
  dur_percent_range = c_emlrt_marshallIn(&st, emlrtAliasP(prhs[3]),
    "dur_percent_range");
  min_dur_dist = c_emlrt_marshallIn(&st, emlrtAliasP(prhs[4]), "min_dur_dist");
  f0_range_in_cents = c_emlrt_marshallIn(&st, emlrtAliasP(prhs[5]),
    "f0_range_in_cents");
  hopsize = c_emlrt_marshallIn(&st, emlrtAliasP(prhs[6]), "hopsize");

  /* Invoke the target function */
  classifyNotes(notes_gt, notes_tr, onset_lim, dur_percent_range, min_dur_dist,
                f0_range_in_cents, hopsize, &Results);

  /* Marshall function outputs */
  plhs[0] = emlrt_marshallOut(&Results);
  emxFreeStruct_struct0_T(&Results);
  notes_tr->canFreeData = false;
  emxFree_real_T(&notes_tr);
  notes_gt->canFreeData = false;
  emxFree_real_T(&notes_gt);
  emlrtHeapReferenceStackLeaveFcnR2012b(&st);
}
/*
 * Arguments    : const mxArray *prhs[19]
 *                const mxArray *plhs[4]
 * Return Type  : void
 */
void clcDP_olyHyb_tmp_api(const mxArray *prhs[19], const mxArray *plhs[4])
{
  emxArray_real_T *engKinNumVec_wayInx;
  emxArray_real_T *slpVec_wayInx;
  emxArray_real_T *engKinMat_engKinInx_wayInx;
  static struct0_T FZG;
  emxArray_real_T *optPreInxTn3;
  emxArray_real_T *batFrcOptTn3;
  emxArray_real_T *fulEngOptTn3;
  emxArray_real_T *cos2goActMat;
  real_T disFlg;
  real_T wayStp;
  real_T batEngStp;
  real_T batEngBeg;
  real_T batPwrAux;
  real_T psiBatEng;
  real_T psiTim;
  real_T staChgPenCosVal;
  real_T wayInxBeg;
  real_T wayInxEnd;
  real_T engKinBegInx;
  real_T engKinNum;
  real_T staNum;
  real_T wayNum;
  real_T staBeg;
  emlrtStack st = { NULL, NULL, NULL };

  st.tls = emlrtRootTLSGlobal;
  emlrtHeapReferenceStackEnterFcnR2012b(&st);
  emxInit_real_T(&st, &engKinNumVec_wayInx, 1, true);
  emxInit_real_T(&st, &slpVec_wayInx, 1, true);
  b_emxInit_real_T(&st, &engKinMat_engKinInx_wayInx, 2, true);
  emxInitStruct_struct0_T(&st, &FZG, true);
  c_emxInit_real_T(&st, &optPreInxTn3, 3, true);
  c_emxInit_real_T(&st, &batFrcOptTn3, 3, true);
  c_emxInit_real_T(&st, &fulEngOptTn3, 3, true);
  b_emxInit_real_T(&st, &cos2goActMat, 2, true);
  prhs[15] = emlrtProtectR2012b(prhs[15], 15, false, -1);
  prhs[16] = emlrtProtectR2012b(prhs[16], 16, false, -1);
  prhs[17] = emlrtProtectR2012b(prhs[17], 17, false, -1);

  /* Marshall function inputs */
  disFlg = emlrt_marshallIn(&st, emlrtAliasP(prhs[0]), "disFlg");
  wayStp = emlrt_marshallIn(&st, emlrtAliasP(prhs[1]), "wayStp");
  batEngStp = emlrt_marshallIn(&st, emlrtAliasP(prhs[2]), "batEngStp");
  batEngBeg = emlrt_marshallIn(&st, emlrtAliasP(prhs[3]), "batEngBeg");
  batPwrAux = emlrt_marshallIn(&st, emlrtAliasP(prhs[4]), "batPwrAux");
  psiBatEng = emlrt_marshallIn(&st, emlrtAliasP(prhs[5]), "psiBatEng");
  psiTim = emlrt_marshallIn(&st, emlrtAliasP(prhs[6]), "psiTim");
  staChgPenCosVal = emlrt_marshallIn(&st, emlrtAliasP(prhs[7]),
    "staChgPenCosVal");
  wayInxBeg = emlrt_marshallIn(&st, emlrtAliasP(prhs[8]), "wayInxBeg");
  wayInxEnd = emlrt_marshallIn(&st, emlrtAliasP(prhs[9]), "wayInxEnd");
  engKinBegInx = emlrt_marshallIn(&st, emlrtAliasP(prhs[10]), "engKinBegInx");
  engKinNum = emlrt_marshallIn(&st, emlrtAliasP(prhs[11]), "engKinNum");
  staNum = emlrt_marshallIn(&st, emlrtAliasP(prhs[12]), "staNum");
  wayNum = emlrt_marshallIn(&st, emlrtAliasP(prhs[13]), "wayNum");
  staBeg = emlrt_marshallIn(&st, emlrtAliasP(prhs[14]), "staBeg");
  c_emlrt_marshallIn(&st, emlrtAlias(prhs[15]), "engKinNumVec_wayInx",
                     engKinNumVec_wayInx);
  c_emlrt_marshallIn(&st, emlrtAlias(prhs[16]), "slpVec_wayInx", slpVec_wayInx);
  e_emlrt_marshallIn(&st, emlrtAlias(prhs[17]), "engKinMat_engKinInx_wayInx",
                     engKinMat_engKinInx_wayInx);
  g_emlrt_marshallIn(&st, emlrtAliasP(prhs[18]), "FZG", &FZG);

  /* Invoke the target function */
  clcDP_olyHyb_tmp(disFlg, wayStp, batEngStp, batEngBeg, batPwrAux, psiBatEng,
                   psiTim, staChgPenCosVal, wayInxBeg, wayInxEnd, engKinBegInx,
                   engKinNum, staNum, wayNum, staBeg, engKinNumVec_wayInx,
                   slpVec_wayInx, engKinMat_engKinInx_wayInx, &FZG, optPreInxTn3,
                   batFrcOptTn3, fulEngOptTn3, cos2goActMat);

  /* Marshall function outputs */
  plhs[0] = emlrt_marshallOut(optPreInxTn3);
  plhs[1] = emlrt_marshallOut(batFrcOptTn3);
  plhs[2] = emlrt_marshallOut(fulEngOptTn3);
  plhs[3] = b_emlrt_marshallOut(cos2goActMat);
  cos2goActMat->canFreeData = false;
  emxFree_real_T(&cos2goActMat);
  fulEngOptTn3->canFreeData = false;
  emxFree_real_T(&fulEngOptTn3);
  batFrcOptTn3->canFreeData = false;
  emxFree_real_T(&batFrcOptTn3);
  optPreInxTn3->canFreeData = false;
  emxFree_real_T(&optPreInxTn3);
  emxFreeStruct_struct0_T(&FZG);
  engKinMat_engKinInx_wayInx->canFreeData = false;
  emxFree_real_T(&engKinMat_engKinInx_wayInx);
  slpVec_wayInx->canFreeData = false;
  emxFree_real_T(&slpVec_wayInx);
  engKinNumVec_wayInx->canFreeData = false;
  emxFree_real_T(&engKinNumVec_wayInx);
  emlrtHeapReferenceStackLeaveFcnR2012b(&st);
}