/*
* File: net_glc_fun.c
*
* MATLAB Coder version : 2.6
* C/C++ source code generated on : 01-Aug-2016 17:27:42
*/
/* Include files */
#include "rt_nonfinite.h"
#include "net_glc_fun.h"
/* Function Definitions */
/*
* NET_GLC_FUN neural network simulation function.
*
* Generated by Neural Network Toolbox function genFunction, 01-Aug-2016 17:20:24.
*
* [y1] = net_glc_fun(x1) takes these arguments:
* x = 3xQ matrix, input #1
* and returns:
* y = 1xQ matrix, output #1
* where Q is the number of samples.
* Arguments : double glc
* double insulin
* double cpep
* Return Type : double
*/
double net_glc_fun(double glc, double insulin, double cpep)
{
double x1[3];
int k;
static const double settings_gain[3] = { 1.25000562189975, 0.0031290148960008,
0.277009574089242 };
static const double settings_xoffset[3] = { 1.70000392892616, 12.9208038828615,
0.760028437825413 };
double b[19];
static const double a[19] = { 3.42093017210012, 2.9430386414708667,
2.3571952513947196, -3.5611770059023589, 0.79381211338056623,
0.97410912708967656, 1.2842025188274149, -3.5463918859922381,
-6.6049692452812616, 1.6276624973847353, 4.5420637538775708,
-8.29230163234388, 8.0930162556110243, 6.333343596386074, 3.6587434161244392,
2.4521883530802921, 2.7404733244778705, 4.3550533909909772,
4.1461418669175183 };
double b_b[19];
double d0;
int i0;
static const double b_a[57] = { 0.06721728705456724, -2.8187992819099987,
-1.5486992042637486, 0.69321764292268362, -0.83208303979112563,
0.35257017104981864, -4.7694757538701813, 6.41312386839963,
9.3647630782610118, -1.6685644674594362, 11.20785624225157,
-8.84708503237788, 8.32606457717145, 2.1714070788033628, 9.0205510972025369,
6.6306970701179884, 3.7257911444219833, 9.63149216966046, 2.8540696333113904,
-3.6440659210095543, 0.32532652774011384, 2.5129258363036766,
-5.37015093714612, -0.22679397401866927, 0.40163084653996967,
-2.7216771625106255, -1.5207989604210006, -20.528289340450062,
5.76392526407906, 5.8405525707589749, -8.9583530549360066, 12.96435300553618,
8.817969633496741, 4.9032641835373925, -0.355014895455146,
1.6828881466217667, -2.1359061698092372, -0.14138356264410198,
-3.6527437844691777, 2.0318828460311544, -0.18431043613623685,
1.0973703971636908, -1.726580454643373, -3.098395977316684,
-2.5294910526653469, -8.2507005722383653, 14.34001884159173,
6.2805956326444905, 1.23954938230253, -7.8655624056693147,
-0.2742871031877408, -4.1881136439579567, 0.59198691261361014,
-2.4144146636043473, -2.1325563522664264, -7.3450960977362669,
-2.658216589598263 };
static const double c_a[19] = { -2.7640140899660439, -2.9198052206587528,
4.9820111941264686, 2.15009151417837, -10.893591989564634,
6.3870060505267912, 1.9416126385739931, 0.69169494494283779,
0.52559912214508331, 0.43750130352239025, 6.2409668218565546,
0.953681996751488, 1.5330829626070177, 3.2395966293667766,
-7.8726654434834984, 1.5558730719219735, -5.6362815601885323,
0.93303747457848873, 4.0101986664913758 };
/* ===== NEURAL NETWORK CONSTANTS ===== */
/* Input 1 */
x1[0] = glc;
x1[1] = insulin;
x1[2] = cpep;
/* Layer 1 */
/* Layer 2 */
/* Output 1 */
/* ===== SIMULATION ======== */
/* Dimensions */
/* samples */
/* Input 1 */
/* ===== MODULE FUNCTIONS ======== */
/* Map Minimum and Maximum Input Processing Function */
for (k = 0; k < 3; k++) {
x1[k] = (x1[k] - settings_xoffset[k]) * settings_gain[k] + -1.0;
}
/* Layer 1 */
memcpy(&b[0], &a[0], 19U * sizeof(double));
/* Sigmoid Symmetric Transfer Function */
for (k = 0; k < 19; k++) {
d0 = 0.0;
for (i0 = 0; i0 < 3; i0++) {
d0 += b_a[k + 19 * i0] * x1[i0];
}
b_b[k] = b[k] + d0;
}
/* Layer 2 */
/* Output 1 */
/* Map Minimum and Maximum Output Reverse-Processing Function */
d0 = 0.0;
for (k = 0; k < 19; k++) {
d0 += c_a[k] * (2.0 / (1.0 + exp(-2.0 * b_b[k])) - 1.0);
}
return ((1.5307560560365561 + d0) - -1.0) / 0.763367047638489 +
3.38000010222326;
}
/*
* File trailer for net_glc_fun.c
*
* [EOF]
*/
net aps.rar_aps
版权申诉
46 浏览量
2022-09-21
20:51:34
上传
评论
收藏 219KB RAR 举报
alvarocfc
- 粉丝: 105
- 资源: 1万+
最新资源
- 2022NOC软件创意编程赛项真题python小学高年级-决赛(有解析)
- mathml转换latex需要的xsl文件
- 2022NOC软件创意编程赛项真题图形化小学高年级-决赛赛(有解析)
- gbase驱动下载gbase-connector-java-8.3.81.53驱动下载
- 2022NOC软件创意编程赛项真题图形化小学低年级-决赛赛(有解析)
- InsightFace从青铜到王者,超大规模人脸识别的优雅解法
- python后端开发spider框架详解
- 基于 STM32 与 ESP8266 的智能家居系统源码.zip
- 毕业设计:基于SSM的mysql-个性化点餐配送系统(源码 + 数据库 + 说明文档)
- 基于matlab的鱼苗计数识别(GUI界面).zip代码57
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈