# include # include /*atoi*/ # include # include "./codegen/lib/targetSpec/targetSpec.h" int main(int argc, char** argv) { int i; double agC, Rls, T1, T1dej, nX, M_mean, R_mean, ecSoilType, eps; // Check number of input arguments if (argc != 9) { printf("Number of arguments is not correct.\n"); printf("Arguments: agc, Rls, T1, T1dej, nX, M_mean, R_mean, ecSoilType\n"); return -1; } else { agC = atof(argv[1]); Rls = atof(argv[2]); T1 = atof(argv[3]); T1dej = atof(argv[4]); nX = atof(argv[5]); M_mean = atof(argv[6]); R_mean = atof(argv[7]); ecSoilType = atof(argv[8]); } struct emxArray_real_T *tSpec = malloc(sizeof(*tSpec)*1); tSpec->data = malloc(sizeof(real_T)*(nX+2)); tSpec->size = malloc(sizeof(int32_T)*1); tSpec->allocatedSize = (sizeof(int32_T)*1); struct emxArray_real_T *PerTgt = malloc(sizeof(*PerTgt)*1); PerTgt->data = malloc(sizeof(real_T)*(nX+2)); PerTgt->size = malloc(sizeof(int32_T)*1); PerTgt->allocatedSize = (sizeof(int32_T)*1); // Call targetSpec function, translated with Matlab Coder targetSpec_initialize(); targetSpec(agC, Rls, T1, T1dej, nX, M_mean, R_mean, ecSoilType, &eps, tSpec, PerTgt); targetSpec_terminate(); printf("%.10f\n", eps); for(i=0; isize[1]; i++) { printf("%.10f,", tSpec->data[i]); } printf("\n"); for(i=0; isize[1]; i++) { printf("%.10f,", PerTgt->data[i]); } return 0; }