c# 调用matlab
1.返回一个整数
function [ a ] = testReturn( b )
%UNTITLED Summary of this function goes here
% Detailed explanation goes here a = b+;
end
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using MathWorks.MATLAB.NET.Arrays;
using MathWorks.MATLAB.NET.Utility;
using MatlabReturn;
namespace MatlabToNet
{
class Program
{
static void Main(string[] args)
{
MWNumericArray input = null;
//MWNumericArray output = null;
MWArray result = null;
ToMatlab matlab = new ToMatlab(); input = ;
result = matlab.testReturn(input);
Console.WriteLine(result); }
}
}
2. 返回两个整数
function [ a , b] = testReturn( c )
%UNTITLED Summary of this function goes here
% Detailed explanation goes here a = c+;
b = c+;
end
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using MathWorks.MATLAB.NET.Arrays;
using MathWorks.MATLAB.NET.Utility;
using MatlabReturn;
namespace MatlabToNet
{
class Program
{
static void Main(string[] args)
{
MWNumericArray input = null;
//MWNumericArray output = null;
MWArray[] result = null;
ToMatlab matlab = new ToMatlab(); input = ;
result = matlab.testReturn( ,input);//2表示输出2个值
Console.WriteLine(result[] +":" +result[]); }
}
}
3.返回多个多种类型的值
function [ a , b ,d] = testReturn( c )
%UNTITLED Summary of this function goes here
% Detailed explanation goes here a = length(c);
b = strcat(c,'liu');
d = strcmp(c,'xin');
end
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using MathWorks.MATLAB.NET.Arrays;
using MathWorks.MATLAB.NET.Utility;
using MatlabReturn;
namespace MatlabToNet
{
class Program
{
static void Main(string[] args)
{
MWCharArray input = null;
//MWNumericArray output = null;
MWArray[] result = null;
ToMatlab matlab = new ToMatlab(); input = "me";
result = matlab.testReturn( ,input);//2表示输出2个值
Console.WriteLine(result[] +":" +result[]+":"+result[]); }
}
}
c# 调用matlab的更多相关文章
- Atitit java c# php c++ js跨语言调用matlab实现边缘检测等功能attilax总结
Atitit java c# php c++ js跨语言调用matlab实现边缘检测等功能attilax总结 1.1. 边缘检测的基本方法Canny最常用了1 1.2. 编写matlab边缘检测代码, ...
- WPF调用Matlab函数方法
有的时候用C#写图像处理方法,比较费事,不如Matlab简单,但是Matlab又做不出WPF那样的好看界面,怎么办呢. 今天正好我要实现这个功能,就顺便写个小例子,给需要的人做个借鉴. 想要用WPF调 ...
- MyEclipse调用Matlab打包函数
本文部分内容参考了http://www.360doc.com/content/15/1103/16/1180274_510463048.shtml 一.检查Java环境 对于已经装上JAVA环境的计算 ...
- 【原创】Matlab.NET混合编程技巧之直接调用Matlab内置函数
本博客所有文章分类的总目录:[总目录]本博客博文总目录-实时更新 Matlab和C#混合编程文章目录 :[目录]Matlab和C#混合编程文章目录 在我的上一篇文章[ ...
- VS2008 C++ 调用MATLAB 2009b 生成的DLL .
转载: 刚开始学习用VC++调用matlab生成的DLL,找了网上一些资料,难以找到vs2008与MATLAB2009b版本的,按照以往版本做的总是有很多错误.经过两天努力,终于调试成功,这里将经验总 ...
- asp.net下调用Matlab生成动态链接库
对于这次论文项目,最后在写一篇关于工程的博客,那就是在asp.net下调用matlab生成的dll动态链接库.至今关于matlab,c/c++(opencv),c#(asp.net)我总共写了4篇配置 ...
- java调用matlab函数
如何将实验结果在matlab中可视化呢,下面使用java语言编程,调用matlab中的函数: 本人安装的是Matlab7.11.0 (R2010a)和 Eclipse 4.2 : 1)首先设置环境变量 ...
- (转)JAVA 调用matlab
本文仅用于学习. 原文地址链接:http://blog.csdn.net/wannshan/article/details/5907877 前段时间摸索了java调用matlab东西,不说学的有多深, ...
- opencv通过dll调用matlab函数,图片作为参数
[blog 项目实战派]opencv通过dll调用matlab函数,图片作为参数 前文介绍了如何“csharp通过dll调用opencv函数,图片作为参数”.而在实 ...
- 使用Java程序调用MatLab
Java代码实现的计算难免会显得不够高效.而利用MATLAB写好相应的计算函数,然后打包成jar包供Java调用,在某些情况下会更加方便.或者有些时候会涉及到使用Java调用MatLab展现一些二维三 ...
随机推荐
- kolla出现问题时的定位方式
前提,对官网问题的一个翻译 Troubleshooting Guide排障手册 1.Failures(失败) If Kolla fails, often it is caused by a CTRL- ...
- json互转笔记
JSON.parse()与JSON.stringify()的区别 JSON.parse()[从一个字符串中解析出json对象] 例子: //定义一个字符串 var data='{"name& ...
- Automake基本用法
一. 确认你的系统安装有GNU的如下软件: 1. automake2. autoconf3. m44. perl5. 如果你需要产生共享库(shared library)则还需要GNU Libtool ...
- Oracle复制表
Oracle复制表分为只复制表结构或者结构和数据均复制两种: 只复制表结构 create table newTableName as select * from oldTableName where ...
- C语言数据结构-队列的实现-初始化、销毁、清空、长度、队列头元素、插入、删除、显示操作
1.数据结构-队列的实现-C语言 //队列的存储结构 #define MAXSIZE 100 typedef struct { int* base; //基地址 int _front; //头指针 i ...
- vue学习三:生命周期钩子
生命周期钩子介绍: 每个 Vue 实例在被创建时都要经过一系列的初始化过程——例如,需要设置数据监听.编译模板.将实例挂载到 DOM 并在数据变化时更新 DOM 等.同时在这个过程中也会运行一些叫做生 ...
- DesiredCapabilities内容详解--Appium服务关键字
上次了解了一些DesiredCapabilities的用法,有些还是不太清楚,去appium官网找了找官方文档,觉得写的很全: ## Appium 服务关键字 <expand_table> ...
- 老男孩python作业9-简单的商城页面布局
利用HTML相关知识编写下面的网页: 核心代码如下: <!DOCTYPE html> <html lang="en"> <head> <m ...
- CPU和微架构的概念
CPU是什么: 中央处理器(CPU,Central Processing Unit)是一块超大规模的集成电路,是一台计算机的运算核心(Core)和控制核心( Control Unit). 它的功能主要 ...
- Avito Cool Challenge 2018:D. Maximum Distance
D. Maximum Distance 题目链接:https://codeforces.com/contest/1081/problem/D 题意: 给出一个连通图以及一些特殊点,现在定义cost(u ...