【发布时间】:2016-02-26 16:56:12
【问题描述】:
我正在做的一个简单的例子如下:
s := t*0.2:
b := matrix([0.5,0.6,0.1]):
f := matrix([sin(s),cos(s),s]):
X := transpose(b)*(f);
plotfunc2d(X,t=-2*PI..2*PI);
错误是:
Error: Expecting an arithmetical expression or a function. Got a 'Dom::Matrix()' for attribute 'Function' in the 'Function2d' object.
所以,我需要将类型从 Dom::Matrix 转换为 Function。我试过了:
coerce(X,DOM_EXPR);
我知道这很简单:
s := t*0.2:
x := 0.5*sin(s)+0.6*cos(s)+0.1*s;
plotfunc2d(x,t=-2*PI..2*PI);
有没有办法转换这些类型?
【问题讨论】: