更新时间:2022-06-26 23:59:32
如果我正确理解了您的问题,则可以使用eval()
函数对字符串求值以检索一个简单的数值示例.
If I understand your question correctly, you can use the eval()
function to evaluate the string to retrieve a simple numerical example.
例如
char s;
char k;
A=solve('(s-1) * exp(-s) = k', 'k=exp(1)');
sol_s=A.s(1);
sol_k=A.k(1);
ans=eval(sol_s)