📄 default.aspx.cs
字号:
using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using MathWorks.MATLAB.NET.Utility;
using MathWorks.MATLAB.NET.Arrays;
using PlotComp;
[assembly: NativeGC(true, GCBlockSize = 25)] // Set native memory management block size to 25 MB.
public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
try
{
const int numPoints = 10; // Number of points to plot
// Allocate native array for plot values
double[,] plotValues = new double[2, numPoints];
// Plot 5x vs x^2
for (int x = 1; x <= numPoints; x++)
{
plotValues[0, x - 1] = x * 5;
plotValues[1, x - 1] = x * x;
}
// Create a new plotter object
Plotter plotter = new Plotter();
// Plot the two sets of values - Note the ability to cast the native array to a MATLAB numeric array
plotter.drawgraph((MWNumericArray)plotValues);
//Console.ReadLine(); // Wait for user to exit application
}
catch (Exception exception)
{
//Console.WriteLine("Error: {0}", exception);
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -