matlab2c使用c++实现matlab函数系列教程-repmat函数
2017-08-26 10:04
1011 查看
全栈工程师开发手册 (作者:栾鹏)
matlab2c动态链接库下载
matlab库函数大全
matlab2c基础教程
matlab2c开发全解教程
2、将Matlab2c.dll拷贝到exe同目录下
3、将Matlab2c.h、Matlab2c.lib放到项目头文件目录下
4、在cpp文件中引入下面的代码
2、用法说明
复制和平铺矩阵:输入为一个矩阵a,以及两个整数m、n,输出以a为元素的m*n的组合矩阵。
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中repmat函数简介
1、repmat函数:复制和平铺矩阵2、用法说明
B = repmat(A,m,n)这是一个处理大矩阵且内容有重复时使用,其功能是以A的内容堆叠在(MxN)的矩阵B中,B矩阵的大小由MxN及A矩阵的内容决定,如果A是一个3x4x5的矩阵,有B = repmat(A,2,3)则最后的矩阵是6x12x5
repmat的c++源码实现
复制和平铺矩阵复制和平铺矩阵:输入为一个矩阵a,以及两个整数m、n,输出以a为元素的m*n的组合矩阵。
Matrix Matlab2c::repmat(Matrix& a,int m,int n) { Matrix p(a.row*m,a.column*n); int i,j; for (i=0;i<p.row;i++) for (j=0;j<p.column;j++) p(i,j)=a(i%a.row,j%a.column); return p; } CMatrix Matlab2c::repmat(CMatrix& a,int m,int n) { CMatrix p(a.row*m,a.column*n); int i,j; for (i=0;i<p.row;i++) for (j=0;j<p.column;j++) p(i,j)=a(i%a.row,j%a.column); return p; }
repmat函数的使用测试
#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;
}
相关文章推荐
- matlab2c使用c++实现matlab函数系列教程-triu函数
- matlab2c使用c++实现matlab函数系列教程-wilkinson函数
- matlab2c使用c++实现matlab函数系列教程-diag函数
- matlab2c使用c++实现matlab函数系列教程-conv函数
- matlab2c使用c++实现matlab函数系列教程-compan函数
- matlab2c使用c++实现matlab函数系列教程-zeros函数
- matlab2c使用c++实现matlab函数系列教程-find函数
- matlab2c使用c++实现matlab函数系列教程-histc函数
- matlab2c使用c++实现matlab函数系列教程-rank函数
- matlab2c使用c++实现matlab函数系列教程-blkdiag函数
- matlab2c使用c++实现matlab函数系列教程-perms函数
- matlab2c使用c++实现matlab函数系列教程-hilb函数
- matlab2c使用c++实现matlab函数系列教程-kron函数
- matlab2c使用c++实现matlab函数系列教程-trace函数
- matlab2c使用c++实现matlab函数系列教程-hankel函数
- matlab2c使用c++实现matlab函数系列教程-fliplr函数
- matlab2c使用c++实现matlab函数系列教程-sign函数
- matlab2c使用c++实现matlab函数系列教程-eye函数
- matlab2c使用c++实现matlab函数系列教程-cat函数
- matlab2c使用c++实现matlab函数系列教程-tril函数