资源简介
/*
* 这是修改过后的fis.c模糊推理系统库函数,可以移植C/C++环境使用,在VS2010的MFC环境经过测试
* 1、将fis.c文件拷贝到项目中;
* 2、修改VS2010的配置属性,项目->属性->C/C++->预处理器->预处理器定义,添加
* _CRT_SECURE_NO_WARNINGS
* 3、在【解决方案资源管理器】中选中fis.c文件,单击右键的属性
* 【配置属性】->【常规】->【项类型】,配置为【C/C++ 标头】
* 4、如果是C语言文件(*.c)使用
* #include "fis.c"
* 包含接口库文件;
* 5、如果是C++文件,使用
* extern "C"{
* #include "fis.c"
* }
* 包含库文件。
* 祝你使用愉快!
* hemmingway 2013/1/2
*/
代码片段和文件信息
/*
* Stand-alone C codes for fuzzy inference systems.
* (This file is included in fis project)
* J.-S. Roger Jang 1994.
* Copyright 1994-2001 The MathWorks Inc.
*/
/*
* 这是修改过后的fis.c模糊推理系统库函数,可以移植C/C++环境使用,在VS2010的MFC环境经过测试
* 1、将fis.c文件拷贝到项目中;
* 2、修改VS2010的配置属性,项目->属性->C/C++->预处理器->预处理器定义,添加
* _CRT_SECURE_NO_WARNINGS
* 3、在【解决方案资源管理器】中选中fis.c文件,单击右键的属性
* 【配置属性】->【常规】->【项类型】,配置为【C/C++ 标头】
* 4、如果是C语言文件(*.c)使用
* #include “fis.c“
* 包含接口库文件;
* 5、如果是C++文件,使用
* extern “C“{
* #include “fis.c“
* }
* 包含库文件。
* 祝你使用愉快!
* hemmingway 2013/1/2
*/
#ifndef __FIS__
# define __FIS__
#include
#include
#include
#include
#pragma warning(disable: 4244)
/***********************************************************************
Macros and definitions
**********************************************************************/
/* Define portable printf and double */
#if defined(MATLAB_MEX_FILE)
# define PRINTF mexPrintf
# define DOUBLE real_T
#elif defined(__SIMSTRUC__)
# define PRINTF ssPrintf
# define DOUBLE real_T
#elif defined(_MSC_VER)
#define PRINTF odprintf
#include
#include
int _cdecl odprintf(const char* fmt ...)
{
char buf[4096] *p=buf;
va_list args;
int ret = -1;
va_start(args fmt);
ret = vsnprintf_s(p sizeof(buf) _TRUNCATE fmt args);
p +=ret;
va_end(args);
while (p>buf && isspace(*p))
{
*--p = ‘\0‘;
*p++ = ‘\r‘;
*p++ = ‘\n‘;
*p = ‘\0‘;
}
OutputDebugStringA(buf);
return(ret);
}
#else
# define PRINTF printf
# define DOUBLE double
#endif
#ifndef ABS
# define ABS(x) ( (x) > (0) ? (x): (-(x)) )
#endif
#ifndef MAX
# define MAX(xy) ( (x) > (y) ? (x) : (y) )
#endif
#ifndef MIN
# define MIN(xy) ( (x) < (y) ? (x) : (y) )
#endif
#define MF_PARA_N 4
#define STR_LEN 500
#define MF_POINT_N 101
/* debugging macros */
/*
#define PRINT(expr) printf(#expr “ = %g\n“ (double)expr)
#define PRINTMAT(matmn) printf(#mat “ = \n“); fisPrintMatrix(matmn)
#define FREEMAT(matm) printf(“Free “ #mat “ ...\n“); fisFreeMatrix(matm)
#define FREEARRAY(array) printf(“Free “ #array “ ...\n“); free(array)
*/
#if (defined(MATLAB_MEX_FILE) && !defined(__SIMSTRUC__))
# define FREE mxFree
#else
# define FREE free
#endif
#define FREEMAT(matm) fisFreeMatrix(matm)
#define FREEARRAY(array) FREE(array)
/***********************************************************************
Data types
**********************************************************************/
typedef struct fis_node FIS;
typedef struct fis_node {
int handle;
int load_param;
char name[STR_LEN];
char type[STR_LEN];
char andMethod[STR_LEN];
char orMethod[STR_LEN];
char impMethod[STR_LEN];
char aggMethod[STR_LEN];
char defuzzMethod[STR_LEN];
int userDefinedAnd;
int userDefinedOr;
int userD 属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 69498 2013-01-03 12:47 fis.c
----------- --------- ---------- ----- ----
69498 1
- 上一篇:FTP客户端源程序 上传
- 下一篇:C++ 桌面宠物-金鱼
相关资源
- 卡尔曼定位程序
- 北京化工大学计算方法(C/C++)讲义
- GBT 28169-2011 嵌入式软件 C语言编码规范
- XUnZip Zip解压缩.rar
- Windows_API_函数大全 C/C++
- C语言程序设计教材习题参考答案.do
- 基于MFC的VC++仿QQ浏览器源码(雏形)
- 高效FFT的C/C++代码实现包括基2的DIF和
- c/c++开发网络验证和本地验证
- 操作系统存储管理实验报告c/c++
- 基于VC、MATLAB的汽车制动性能仿真
- C++编写的万年历源码
- MATLAB通信仿真及应用详解附超星阅读
- C语言进阶源码---基于graphics实现图书
- filtfilt C语言实现,可直接运行验证
- 井字棋三连棋的AI实现,C/C++
- 《水果忍者》设计报告.doc
- MFC实现的红绿灯程序
- 台湾林智仁开发的libsvm-3.0.1
- Matlab与C++混合程序设计第三版
- 粒子群算法及其代码实现
- Win32简易画图程序
- 九轴姿态解算matlab源代码 两种方法代
- C++网络爬虫项目
- 泡泡堂(炸弹人)小游戏C/C++完整源码
- 使用C/C++读取BITMAP的内容
- VC图像处理-用Canny算子提取边缘
- C/C++视频教程
- 经纬度坐标转换为平面坐标的matlab实
- 个人总结的一些C/C++编码规范
川公网安备 51152502000135号
评论
共有 条评论