matlab2c使用c++实现matlab函数系列教程-cat函数
来源:互联网 发布:网页淘宝怎么收藏店铺 编辑:程序博客网 时间:2024/05/22 13:16
全栈工程师开发手册 (作者:栾鹏)
matlab2c动态链接库下载
matlab库函数大全
matlab2c基础教程
matlab2c开发全解教程
matlab2c调用方法:
1、下载动态链接库
2、将Matlab2c.dll拷贝到exe同目录下
3、将Matlab2c.h、Matlab2c.lib放到项目头文件目录下
4、在cpp文件中引入下面的代码
#include "Matlab2c.h"#pragma comment(lib,"Matlab2c.lib") using namespace Matlab2c;
matlab中cat函数简介
1、cat函数: 按dim来联结A和B两个数组
2、用法说明
C = cat(dim, A, B),dim=1,矩阵横向合并等价于[a,b],dim=2矩阵纵向合并等价于[a;b]
cat的c++源码实现
矩阵合并
目前支持两维合并,dim=1,矩阵横向合并等价于[a,b],dim=2矩阵纵向合并等价于[a;b]
Matrix Matlab2c::cat(int dim,Matrix& a,Matrix& b){ Matrix p(a); switch (dim) { case 1: p.append_bottom(b); return p; case 2: p.append_right(b); return p; default: p.append_bottom(b); return p; }}CMatrix Matlab2c::cat(int dim,CMatrix& a,CMatrix& b){ CMatrix p(a); switch (dim) { case 1: p.append_bottom(b); return p; case 2: p.append_right(b); return p; default: p.append_bottom(b); return p; }}
cat函数的使用测试
#include "Matlab2c.h"#pragma comment(lib,"Matlab2c.lib") using namespace Matlab2c;int main(){ double a[]={1,2,3,4,5,6}; Matrix aa=Matrix(2,3,a); Matrix cc=Matlab2c::repmat(aa,2,3); cout<<cc.toString()<<endl; system("pause"); return 0;}
阅读全文
1 0
- matlab2c使用c++实现matlab函数系列教程-cat函数
- 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函数
- 解决Perhaps JAVA_HOME does not point to the JDK.
- CXF+Spring+Tomcat简明示例
- Python 代码规范小结
- Java NIO系列教程(九) ServerSocketChannel
- 用TensorFlow构建基础的神经网络(三):AlexNet
- matlab2c使用c++实现matlab函数系列教程-cat函数
- java毕向东学习笔记——day10
- 写代码怎能不会这些Linux命令?
- Java NIO系列教程(十) Java NIO DatagramChannel
- 史上最全设计模式导学目录(完整版)
- R实战:【股票分析】用quantmod包绘制K线(离线数据csv/txt)
- MFC创建透明CBrush
- Akka(20): Stream:异步运算,压力缓冲-Async, batching backpressure and buffering
- Hadoop中的setOutputKeyClass和setOutputValueClass