/* * mean.c * * Code generation for function 'mean' * * C source code generated on: Wed Aug 26 14:59:33 2015 * */ /* Include files */ #include "rt_nonfinite.h" #include "Select_Ground_Motions.h" #include "mean.h" #include "Select_Ground_Motions_emxutil.h" #include "sum.h" #include "isequal.h" #include "Select_Ground_Motions_mexutil.h" /* Variable Definitions */ static emlrtRSInfo dm_emlrtRSI = { 17, "mean", "/usr/local/MATLAB/R2013a/toolbox/eml/lib/matlab/datafun/mean.m" }; static emlrtRSInfo em_emlrtRSI = { 20, "mean", "/usr/local/MATLAB/R2013a/toolbox/eml/lib/matlab/datafun/mean.m" }; static emlrtRSInfo fm_emlrtRSI = { 36, "mean", "/usr/local/MATLAB/R2013a/toolbox/eml/lib/matlab/datafun/mean.m" }; static emlrtMCInfo ec_emlrtMCI = { 18, 9, "mean", "/usr/local/MATLAB/R2013a/toolbox/eml/lib/matlab/datafun/mean.m" }; static emlrtMCInfo fc_emlrtMCI = { 17, 19, "mean", "/usr/local/MATLAB/R2013a/toolbox/eml/lib/matlab/datafun/mean.m" }; static emlrtMCInfo gc_emlrtMCI = { 23, 9, "mean", "/usr/local/MATLAB/R2013a/toolbox/eml/lib/matlab/datafun/mean.m" }; static emlrtMCInfo hc_emlrtMCI = { 20, 19, "mean", "/usr/local/MATLAB/R2013a/toolbox/eml/lib/matlab/datafun/mean.m" }; static emlrtRTEInfo mc_emlrtRTEI = { 1, 14, "mean", "/usr/local/MATLAB/R2013a/toolbox/eml/lib/matlab/datafun/mean.m" }; /* Function Definitions */ void mean(const emxArray_real_T *x, emxArray_real_T *y) { boolean_T b14; const mxArray *b_y; static const int32_T iv59[2] = { 1, 31 }; const mxArray *m19; char_T cv77[31]; int32_T i; static const char_T cv78[31] = { 'C', 'o', 'd', 'e', 'r', ':', 't', 'o', 'o', 'l', 'b', 'o', 'x', ':', 'm', 'e', 'a', 'n', '_', 's', 'p', 'e', 'c', 'i', 'a', 'l', 'E', 'm', 'p', 't', 'y' }; const mxArray *c_y; static const int32_T iv60[2] = { 1, 36 }; char_T cv79[36]; static const char_T cv80[36] = { 'C', 'o', 'd', 'e', 'r', ':', 't', 'o', 'o', 'l', 'b', 'o', 'x', ':', 'a', 'u', 't', 'o', 'D', 'i', 'm', 'I', 'n', 'c', 'o', 'm', 'p', 'a', 't', 'i', 'b', 'i', 'l', 'i', 't', 'y' }; int32_T d_y; int32_T b_x; b14 = !b_isequal(x); if (b14) { } else { emlrtPushRtStackR2012b(&dm_emlrtRSI, emlrtRootTLSGlobal); b_y = NULL; m19 = mxCreateCharArray(2, iv59); for (i = 0; i < 31; i++) { cv77[i] = cv78[i]; } emlrtInitCharArrayR2013a(emlrtRootTLSGlobal, 31, m19, cv77); emlrtAssign(&b_y, m19); error(message(b_y, &ec_emlrtMCI), &fc_emlrtMCI); emlrtPopRtStackR2012b(&dm_emlrtRSI, emlrtRootTLSGlobal); } if (((x->size[0] == 1) && (x->size[1] == 1)) || (x->size[0] != 1)) { b14 = TRUE; } else { b14 = FALSE; } if (b14) { } else { emlrtPushRtStackR2012b(&em_emlrtRSI, emlrtRootTLSGlobal); c_y = NULL; m19 = mxCreateCharArray(2, iv60); for (i = 0; i < 36; i++) { cv79[i] = cv80[i]; } emlrtInitCharArrayR2013a(emlrtRootTLSGlobal, 36, m19, cv79); emlrtAssign(&c_y, m19); error(message(c_y, &gc_emlrtMCI), &hc_emlrtMCI); emlrtPopRtStackR2012b(&em_emlrtRSI, emlrtRootTLSGlobal); } emlrtPushRtStackR2012b(&fm_emlrtRSI, emlrtRootTLSGlobal); sum(x, y); i = y->size[0] * y->size[1]; y->size[0] = 1; emxEnsureCapacity((emxArray__common *)y, i, (int32_T)sizeof(real_T), &mc_emlrtRTEI); i = y->size[0]; d_y = y->size[1]; b_x = x->size[0]; d_y *= i; for (i = 0; i < d_y; i++) { y->data[i] /= (real_T)b_x; } emlrtPopRtStackR2012b(&fm_emlrtRSI, emlrtRootTLSGlobal); } /* End of code generation (mean.c) */