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的更多相关文章

  1. Atitit java c# php c++ js跨语言调用matlab实现边缘检测等功能attilax总结

    Atitit java c# php c++ js跨语言调用matlab实现边缘检测等功能attilax总结 1.1. 边缘检测的基本方法Canny最常用了1 1.2. 编写matlab边缘检测代码, ...

  2. WPF调用Matlab函数方法

    有的时候用C#写图像处理方法,比较费事,不如Matlab简单,但是Matlab又做不出WPF那样的好看界面,怎么办呢. 今天正好我要实现这个功能,就顺便写个小例子,给需要的人做个借鉴. 想要用WPF调 ...

  3. MyEclipse调用Matlab打包函数

    本文部分内容参考了http://www.360doc.com/content/15/1103/16/1180274_510463048.shtml 一.检查Java环境 对于已经装上JAVA环境的计算 ...

  4. 【原创】Matlab.NET混合编程技巧之直接调用Matlab内置函数

                  本博客所有文章分类的总目录:[总目录]本博客博文总目录-实时更新    Matlab和C#混合编程文章目录 :[目录]Matlab和C#混合编程文章目录 在我的上一篇文章[ ...

  5. VS2008 C++ 调用MATLAB 2009b 生成的DLL .

    转载: 刚开始学习用VC++调用matlab生成的DLL,找了网上一些资料,难以找到vs2008与MATLAB2009b版本的,按照以往版本做的总是有很多错误.经过两天努力,终于调试成功,这里将经验总 ...

  6. asp.net下调用Matlab生成动态链接库

    对于这次论文项目,最后在写一篇关于工程的博客,那就是在asp.net下调用matlab生成的dll动态链接库.至今关于matlab,c/c++(opencv),c#(asp.net)我总共写了4篇配置 ...

  7. java调用matlab函数

    如何将实验结果在matlab中可视化呢,下面使用java语言编程,调用matlab中的函数: 本人安装的是Matlab7.11.0 (R2010a)和 Eclipse 4.2 : 1)首先设置环境变量 ...

  8. (转)JAVA 调用matlab

    本文仅用于学习. 原文地址链接:http://blog.csdn.net/wannshan/article/details/5907877 前段时间摸索了java调用matlab东西,不说学的有多深, ...

  9. opencv通过dll调用matlab函数,图片作为参数

    [blog 项目实战派]opencv通过dll调用matlab函数,图片作为参数                   前文介绍了如何“csharp通过dll调用opencv函数,图片作为参数”.而在实 ...

  10. 使用Java程序调用MatLab

    Java代码实现的计算难免会显得不够高效.而利用MATLAB写好相应的计算函数,然后打包成jar包供Java调用,在某些情况下会更加方便.或者有些时候会涉及到使用Java调用MatLab展现一些二维三 ...

随机推荐

  1. Java整体之JavaEE

    思维导图 (Xmind)链接:http://pan.baidu.com/s/1pKTOTRH 密码:oq7f <iframe src="http://www.xmind.net/emb ...

  2. web安全-xss攻击

    web安全问题 xss攻击 1.html标签 html内容的转义 escapeHtml str = str.replace(/&/g,'&amp'); str = str.replac ...

  3. Kbuild、Kconfig、make menuconfig、.config、Makefile之间的关系

    今天突发奇想,想在这里分享下比喻分析Kbuild ---->去饭店吃饭的过程.   1.Kconfig --->饭店的菜单 2.条件编译选项--->菜单中的每一盘菜,可以选择这个菜的 ...

  4. C++_对象之间的关系与继承

    派生类和基类之间的特殊关系是基于C++继承的底层模型的. 实际上,C++有3种继承方式:公有继承.保护继承.私有继承. 公有继承是最常见的关系,它建立一种is-a的关系,即派生类对象也是一种基类,可以 ...

  5. AJAX使用说明书 基础

    AJAX简介 什么是AJAX AJAX(Asynchronous Javascript And XML)翻译成中文就是“异步Javascript和XML”.即使用Javascript语言与服务器进行异 ...

  6. Experimental Educational Round: VolBIT Formulas Blitz B

    Description The city administration of IT City decided to fix up a symbol of scientific and technica ...

  7. java Sprint boot 学习之一

    <properties> <project.build.sourceEncoding>UTF-</project.build.sourceEncoding> < ...

  8. centos7-根据端口号查看所属应用

    [root@cent7-zuoys ~]# netstat -lnp | grep 8080 [root@cent7-zuoys ~]# ps 4735

  9. Problem06 求最大公约数及最小公倍数

    题目:输入两个正整数m和n,求其最大公约数(m,n)和最小公倍数[m,n]. 程序分析:利用辗转相除法. 利用辗除法:用较大数除以较小数,再用出现的余数(第一余数)去除除数, 再用出现的余数(第二余数 ...

  10. 爬虫(POST)——有道翻译(有bug)

    工具:python3 过程:抓包得到有道翻页面的url:复制post请求头,得到headers中的信息:复制post请求的body,得到formdata中的信息.构造post请求,返回响应 impor ...