matlab2c使用c++实现matlab函数系列教程-exppdf函数
来源:互联网 发布:linux上jsp页面跳转 编辑:程序博客网 时间:2024/06/06 12:22
全栈工程师开发手册 (作者:栾鹏)
matlab2c动态链接库下载
matlab库函数大全
matlab2c基础教程
matlab2c开发全解教程
matlab2c调用方法:
1、下载matlab2c动态链接库
2、将matlab2c.dll、matlab2c.lib和matlab2c.h放到项目头文件目录下
3、在cpp文件中引入下面的代码
#include "Matlab2c.h"#pragma comment(lib,"Matlab2c.lib") using namespace Matlab2c;
matlab中exppdf函数简介
1、exppdf函数:
参数为Lambda的指数分布概率密度函数值
2、用法说明
x = 0:0.1:10;
y = exppdf(x,2); 参数Lambda为2,求在x矩阵点上的值
exppdf的c++源码实现
指数分布函概率值
输入:欲求pdf的点向量,指数分布的参数lambda
输出:相应的pdf值
Matrix Matlab2c::exppdf(Matrix& a,double Lambda){ int i,j; Matrix p(a.row,a.column); for (i=0;i<p.row;i++) for (j=0;j<p.column;j++) if(a(i,j)>=0) p(i,j) = (double)(Lambda*std::exp(-Lambda*a(i,j))); else p(i,j) =0; return p;}
exppdf函数的使用测试
#include "Matlab2c.h"#pragma comment(lib,"Matlab2c.lib") using namespace Matlab2c;int main(){ double a[]={0.1,0.2,0.3,0.4,0.5,0.6}; Matrix aa=Matrix(2,3,a); Matrix dd=Matlab2c::exppdf(aa,3.5); cout<<dd.toString()<<endl; system("pause"); return 0;}
阅读全文
1 0
- matlab2c使用c++实现matlab函数系列教程-exppdf函数
- matlab2c使用c++实现matlab函数系列教程-blkdiag函数
- matlab2c使用c++实现matlab函数系列教程-compan函数
- matlab2c使用c++实现matlab函数系列教程-eye函数
- matlab2c使用c++实现matlab函数系列教程-hankel函数
- matlab2c使用c++实现matlab函数系列教程-hilb函数
- matlab2c使用c++实现matlab函数系列教程-ones函数
- matlab2c使用c++实现matlab函数系列教程-zeros函数
- matlab2c使用c++实现matlab函数系列教程-pascal函数
- matlab2c使用c++实现matlab函数系列教程-toeplitz函数
- matlab2c使用c++实现matlab函数系列教程-wilkinson函数
- matlab2c使用c++实现matlab函数系列教程-diag函数
- matlab2c使用c++实现matlab函数系列教程-tril函数
- matlab2c使用c++实现matlab函数系列教程-triu函数
- matlab2c使用c++实现matlab函数系列教程-fliplr函数
- matlab2c使用c++实现matlab函数系列教程-flipud函数
- matlab2c使用c++实现matlab函数系列教程-reshape函数
- matlab2c使用c++实现matlab函数系列教程-rot90函数
- 原生JS forEach()和map()遍历的区别以及兼容写法,jQuery $.each()和$.map()遍历
- 静态网页开发技术
- STL 中map中find和map[]
- java manacher算法计算最长回文字符串
- OpenStack修改节点IP地址
- matlab2c使用c++实现matlab函数系列教程-exppdf函数
- [笔记分享] [RPM] RPM抓取log方法
- BZOJ1096: [ZJOI2007]仓库建设
- 什么是spring,它有什么特点?
- Hystrix的原理与使用
- ROS 安装与配置
- 方法重载
- SpringMVC学习总结
- 编写Shell脚本的最佳实践