⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ex2.cpp

📁 c++ 调用matlab的程序 c 调用matlab的程序例子
💻 CPP
字号:
/* $Revision: 1.5 $ */// Copyright (c) 1995-1999 The MathWorks, Inc. All Rights Reserved.//// ex2.cpp//// Calling Library Routines#include "matlab.hpp"#include <stdlib.h>     /* used for EXIT_SUCCESS */#ifdef GCC #ifndef EXIT_SUCCESS  #define EXIT_SUCCESS 0 #endif#endifstatic double data[] = { 1, 3, 5, 7, 2, 4, 6, 8 };int main(void){  // create the input matrix  mwArray X(4, 2, data);  mwArray U, S, V;  // compute the singular value decompostion of the matrix  cout << "One input, one output: " << endl;  cout << "S = " << svd(X) << endl;  // pass in optional output arguments  U = svd(&S, &V, X);  cout << "One input, three outputs: " << endl;  cout << "U = " << U << "S = " << S << "V = " << V << endl;  // pass in optional argument  U = svd(&S, &V, X, 0.0);  cout << "Two inputs, three outputs: " << endl;  cout << "U = " << U << "S = " << S << "V = " << V;  return(EXIT_SUCCESS);}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -