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展现一些二维三 ...
随机推荐
- Kali Linux介绍篇
Kali Linux 官网:https://www.kali.org/ Kali Linux 前身是著名渗透测试系统BackTrack ,是一个基于 Debian 的 Linux 发行版,包含很多安全 ...
- 选择性搜索(Selective Search)
1 概述 本文牵涉的概念是候选区域(Region Proposal ),用于物体检测算法的输入.无论是机器学习算法还是深度学习算法,候选区域都有用武之地. 2 物体检测和物体识别 物体识别是要分辨出图 ...
- vue_cli下开发一个简单的模块权限系统之展现数据
这个页面是用户列表:userList就是第二张截图中的data里面的userList vue中只要改变存放数据的载体就会实现页面改变,mounted的意思是页面加载时执行这里面的函数,我们需要在页面加 ...
- Xml Helper
类的完整代码: using System;using System.Collections;using System.Xml; namespace Keleyi.Com.XmlDAL{public c ...
- 状压DP【洛谷P1896】 [SCOI2005]互不侵犯
P1896 [SCOI2005]互不侵犯 题目描述 在N×N的棋盘里面放K个国王,使他们互不攻击,共有多少种摆放方案.国王能攻击到它上下左右,以及左上左下右上右下八个方向上附近的各一个格子,共8个格子 ...
- NSArray,NSMutable和NSSet,NSMutableSet和NSDictionary,NSMutableDictionary用法
开始编写应用程序的代码时,可以利用大量的 Objective-C 框架.其中,为所有应用程序提供基本服务的 Foundation 框架尤为重要.Foundation 框架包括表示基本数据类型的值类(如 ...
- angularJs分层服务开发
//控制层 app.controller('brandController' ,function($scope,$controller ,brandService){ $controller('bas ...
- java的MAP接口方法
常用操作说明 void clear() 从此映射中移除所有映射关系(可选操作). boolean containsKey(Object key) 如果此映射包含指定键的映射关系,则返回 true. b ...
- IDEA 文档注释 乱码 终极... 解决方案
idea bin 目录 下 phpstorm64.exe.vmoptions 最后一行添加 : -Dfile.encoding=UTF-8
- 读书笔记:编程小白的第一本python入门书
书名:编程小白的第一本python入门书 作者:侯爵 出版社/出处:图灵社区 年份:2016年 封面: 感想: 本书短小精悍,精华部分在于给编程小白打了鸡血的同时输出了一种“高效学习法的思想”. 个人 ...