c# - 从.net 调用mathematica
问题描述
我正在使用 C# 从 Visual Studio 调用 Mathematica。我面临错误 -
“错误代码:1012。协议不可用”。
我正在使用 Windows 窗体从设备获取数据并将其发送到 Mathematica 工具并进行一些处理,并且需要将处理后的数据返回到 Windows 窗体 UI。请看下面的代码。
private void button1_Click(object sender, System.EventArgs e)
{
// This launches the Mathematica kernel:
IKernelLink ml = MathLinkFactory.CreateKernelLink();
ml.WaitAndDiscardAnswer();
// Now compute 2+2
string result = ml.EvaluateToOutputForm("2+2", 0);
Console.WriteLine("2 + 2 = " + result);
ml.Close();
// Wait for user to close window.
Console.WriteLine("Press Return to exit...");
Console.Read();
}
解决方案
推荐阅读
- javafx - 子控制器丢失从 MainController 传递的数据
- php - 函数内的nowdoc
- sql - sql中的模糊匹配
- c - LCD 的延迟与精确的定时器中断
- python-3.x - 保留必须满足某些约束的行有点复杂
- c++ - 使用 Bazel 构建后自动复制可执行文件
- c# - 当我将 ApplicationUser 属性添加到模型时,创建 ActionResult 不起作用
- grid - Bootstrap col-xs-6 仍然堆叠而不是并排显示 2 个 png 图像
- ruby-on-rails - Rails - Redis 中的 Sidekiq 状态为空
- php - 如何使用 array_search 循环员工出勤以从数据对象中获取当前员工的出勤天数