資源簡(jiǎn)介
第一次整,不知道怎么整成免費(fèi)的,不好意思了。c#調(diào)用matlab的過(guò)程

代碼片段和文件信息
using?System;
using?System.Collections.Generic;
using?System.ComponentModel;
using?System.Data;
using?System.Drawing;
using?System.Linq;
using?System.Text;
using?System.Threading.Tasks;
using?System.Windows.Forms;
using?System.Runtime.InteropServices;
using?MathWorks.MATLAB.NET.Arrays;
using?MathWorks.MATLAB.NET.Utility;
using?timeplot;
namespace?log_normal
{
?
??
????public?partial?class?Form1?:?Form
????{
????????double[]?array;
????????public?Form1()
????????{
????????????InitializeComponent();
????????}
????????double?AverageRandom(double?min?double?max)//產(chǎn)生(minmax)之間均勻分布的隨機(jī)數(shù)
????????{
????????????int?MINnteger?=?(int)(min?*?10000);
????????????int?MAXnteger?=?(int)(max?*?10000);
????????????Random?rand?=?new?Random();
????????????int?randInteger?=?rand.Next()?*?rand.Next();
????????????int?diffInteger?=?MAXnteger?-?MINnteger;
????????????int?resultInteger?=?randInteger?%?diffInteger?+?MINnteger;
????????????return?resultInteger?/?10000.0;
????????}
????????double?LogNormal(double?x?double?miu?double?sigma)?//對(duì)數(shù)正態(tài)分布概率密度函數(shù)
????????{
????????????return?1.0?/?(x?*?System.Math.Sqrt(2?*?3.14159)?*?sigma)?*?System.Math.Exp(-1?*?(System.Math.Log10(x)?-?miu)?*?(System.Math.Log10(x)?-?miu)?/?(2?*?sigma?*?sigma));
????????}
????????double?Random_LogNormal(double?miu?double?sigma?double?min?double?max)//產(chǎn)生對(duì)數(shù)正態(tài)分布隨機(jī)數(shù)
????????{
????????????double?x;
????????????double?dScope;
????????????double?y;
????????????do
????????????{
????????????????x?=?AverageRandom(min?max);
????????????????y?=?LogNormal(x?miu?sigma);
????????????????dScope?=?AverageRandom(0?LogNormal(miu?miu?sigma));
????????????}?while?(dScope?>?y);
????????????return?System.Math.Abs(x);
????????}
????????private?void?makerand_Click(object?sender?EventArgs?e)
????????{
????????????timer1.Start();
?????????
????????}????
????????int?currentCount=0;
????????double[]?timespace?=?new?double[50];
????????double[]?time?=?new?double[51];
????????private?void?timer1_Tick(object?sender?EventArgs?e)
????????{
????????????if?(currentCount?50)
????????????{
????????????????timespace?[currentCount]=?Random_LogNormal(0.01?8?0.1?15);
????????????????ListViewItem?lvi?=?new?ListViewItem();
????????????????lvi.Text?=?timespace[currentCount].ToString();
????????????????biaoge.Items.Add(lvi);
????????????????currentCount?+=?1;
????????????????time[currentCount]?=?time[currentCount?-?1]?+?timespace[currentCount?-?1];???????????????
????????????}
????????????else
????????????{
????????????????timer1.Stop();
????????????}??????????????????????
????????}
????????
???????
????????private?void?plot_Click(object?sender?EventArgs?e)
????????{
???????????MWNumericArray?plot?=?timespace;
????????????//調(diào)用MAT
????????????plotthetime?pl?=?new?plotthetime();
????????????
????????????pl.timeplot(plot);
??????????
????????}??????
????}
}
?屬性????????????大小?????日期????時(shí)間???名稱
-----------?---------??----------?-----??----
?????文件????????184??2018-03-21?19:18??log-normal\log-normal\App.config
?????文件??????10752??2018-03-23?15:37??log-normal\log-normal\bin\Debug\log-normal.exe
?????文件????????184??2018-03-21?19:18??log-normal\log-normal\bin\Debug\log-normal.exe.config
?????文件??????30208??2018-03-23?15:37??log-normal\log-normal\bin\Debug\log-normal.pdb
?????文件??????24216??2018-03-23?14:25??log-normal\log-normal\bin\Debug\log-normal.vshost.exe
?????文件????????184??2018-03-21?19:18??log-normal\log-normal\bin\Debug\log-normal.vshost.exe.config
?????文件????????490??2013-06-18?20:28??log-normal\log-normal\bin\Debug\log-normal.vshost.exe.manifest
?????文件??????33792??2018-03-21?19:11??log-normal\log-normal\bin\Debug\timeplot.dll
?????文件???????3012??2018-03-23?15:37??log-normal\log-normal\Form1.cs
?????文件???????3879??2018-03-23?15:37??log-normal\log-normal\Form1.Designer.cs
?????文件???????6011??2018-03-23?15:37??log-normal\log-normal\Form1.resx
?????文件???????4342??2018-03-21?19:18??log-normal\log-normal\log-normal.csproj
?????文件???????1471??2018-03-21?14:24??log-normal\log-normal\lognormalrand.cs
?????文件???????1161??2018-03-21?19:18??log-normal\log-normal\obj\Debug\DesignTimeResolveAssemblyReferences.cache
?????文件???????7003??2018-03-23?14:25??log-normal\log-normal\obj\Debug\DesignTimeResolveAssemblyReferencesInput.cache
?????文件????????713??2018-03-23?14:25??log-normal\log-normal\obj\Debug\log-normal.csproj.FileListAbsolute.txt
?????文件????????977??2018-03-23?15:37??log-normal\log-normal\obj\Debug\log-normal.csproj.GenerateResource.Cache
?????文件??????13686??2018-03-21?19:18??log-normal\log-normal\obj\Debug\log-normal.csprojResolveAssemblyReference.cache
?????文件??????10752??2018-03-23?15:37??log-normal\log-normal\obj\Debug\log-normal.exe
?????文件??????30208??2018-03-23?15:37??log-normal\log-normal\obj\Debug\log-normal.pdb
?????文件????????180??2018-03-23?15:37??log-normal\log-normal\obj\Debug\log_normal.Form1.resources
?????文件????????180??2018-03-21?19:18??log-normal\log-normal\obj\Debug\log_normal.Properties.Resources.resources
?????文件??????????0??2018-03-21?13:08??log-normal\log-normal\obj\Debug\TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs
?????文件??????????0??2018-03-21?13:08??log-normal\log-normal\obj\Debug\TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs
?????文件??????????0??2018-03-21?13:08??log-normal\log-normal\obj\Debug\TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs
?????文件???????4608??2018-03-23?15:34??log-normal\log-normal\obj\Debug\TempPE\Properties.Resources.Designer.cs.dll
?????文件????????542??2018-03-21?15:56??log-normal\log-normal\Program.cs
?????文件???????1344??2018-03-21?13:08??log-normal\log-normal\Properties\AssemblyInfo.cs
?????文件???????2860??2018-03-21?19:18??log-normal\log-normal\Properties\Resources.Designer.cs
?????文件???????5612??2018-03-21?13:08??log-normal\log-normal\Properties\Resources.resx
............此處省略47個(gè)文件信息
評(píng)論
共有 條評(píng)論