|
SOLUTIONS
|
MATHEMATICA MATHLINK C 函数
MLEvaluateString()
int MLEvaluateString(MLINK link, char *string)
发送一个字符串给 Mathematica 进行计算,放弃响应中发送的任何数据包.
范例范例打开所有单元关闭所有单元
基本范例 (1)基本范例 (1)
:Begin:
:Function: f
:Pattern: KernelTime[]
:Arguments: {}
:ArgumentTypes: Manual
:ReturnType: Manual
:End:
#include "mathlink.h"
/* read the Kernel's response from evaluating the expression
{Date[],$TimeZone} */
void f(void)
{
/* Pretend we are not in our local timezone. */
if(! MLEvaluateString(stdlink, "$TimeZone = 9;"))
{ /* unable to send $TimeZone = 9; to stdlink */ }
if(! MLEvaluate(stdlink, "{Date[],$TimeZone}"))
{ /* unable to send the expression to stdlink */ }
/* get the Kernel's response */
switch(MLGetType(stdlink))
{
/* ... */
}
/* ... */
}
Mathematica 9 is now available!
New to Mathematica?
Find your learning path »
Have a question?
Ask support »
