ex1.cpp
来自「《精通matlab与c++混合编程》的光盘内容」· C++ 代码 · 共 33 行
CPP
33 行
#include "stdafx.h"
#include "matlab.hpp"
#include <stdlib.h>
#ifdef GCC
#ifndef EXIT_SUCCESS
#define EXIT_SUCCESS 0
#endif
#endif
static double data[] = { 1, 2, 3, 4, 5, 6 };
int main(void)
{
// 创建矩阵
mwArray mat0(2, 3, data);
mwArray mat1(3, 2, data);
// 矩阵输出
cout << mat0 << endl;
cout << mat1 << endl;
// 输入矩阵并将输入的矩阵输出
cout << "Please enter a matrix: " << endl;
cin >> mat1;
cout << mat1 << endl;
return(EXIT_SUCCESS);
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?