|
SOLUTIONS
|
MATHEMATICA MATHLINK C 函数
MLEvaluate()
int MLEvaluate(MLINK link, char*string)
发送一个适于与 ToExpression[] 一起使用的输入字符串给 Mathematica 以便计算.
更多信息更多信息
- 不像 MLEvaluateString(),MLEvaluate() 将丢弃响应的数据包.
- MLEvaluate() 只可用于 mprep MathLink 模板 程序.
- MLEvaluate() 失败时返回0,成功时为非零值.
- MLEvaluate() 在 MathLink 的标头文件 mathlink.h 中被声明.
范例范例打开所有单元关闭所有单元
基本范例 (1)基本范例 (1)
:Begin:
:Function: f
:Pattern: KernelTime[]
:Arguments: {}
:ArgumentTypes: Manual
:ReturnType: Manual
:End:
#include "mathlink.h"
/* read the Kernel's response to its evaluation of
{Date[], $TimeZone} */
void f(void)
{
if(! MLEvaluate(stdlink, "{Date[],$TimeZone}"))
{ /* unable to send the expression to stdlink */ }
/* now read the Kernel's response */
switch(MLGetType(stdlink))
{
/* ... */
}
/* ... */
}
Mathematica 9 is now available!
New to Mathematica?
Find your learning path »
Have a question?
Ask support »
