c# 调用matlab
2024-09-27 06:50:25
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[]); }
}
}
最新文章
- React的井字过三关(3)
- android 选择图片或拍照时旋转了90度问题
- Centos 7.0添加yum本地安装源
- 在WPF下快速生成线的方法
- 用c#实现$.now()(1437813924915)的时间效果
- ab测试大并发错误
- 如何在IIS7上配置 FTP7并使用IIS管理凭据方式进行验证?
- trackr: An AngularJS app with a Java 8 backend – Part I
- lightoj1017 dp
- asp.net(C#)禁止缓存文件
- JSP SMARTUPLOAD组件:上传文件时同时获取表单参数
- android 中FragmentActivity中模拟返回键返回上一个Activity效果
- 如何查看.Net源代码vs版本号以及C#项目中各文件的含义
- gc overhead limit exceeded eclipse错误解决方式
- Ubuntu14.04下安装ZendStudio10.6.1+SVN出现Failed to load JavaHL Library
- HDU-5157Harry and magic string
- Linux的打印rpm包的详细信息的shell脚本
- js常用正则表达式表单验证代码
- i春秋——Misc之百度杯
- linux 之 shell