Please note that the recommended version of Scilab is 2025.0.0. This page might be outdated.
See the recommended documentation of this function
rational
Scilab オブジェクト, Scilabの有理数
説明
有理数 r
は,2つの多項式の商r=num/den
です.
有理数の内部表現はリストです.
An array R
of rationals can be directly defined as the elementwise
quotient of two polynomial arrays Num
and Den
:
R = Num./Den
.
The internal representation of a rational is a list of type "r":
R = tlist(['r','num','den','dt'], Num, Den,[])
, or
R = rlist(Num, Den, [])
.
All usual operators can be used with arrays of rationals:
' .' + - * .* / ./ .^ .*. [,] [;]
,
As for polynomials, the horner()
function allows to compute
the value of rationals for some value of their variable.
Many other Scilab functions can be used with rationals input : permute
,
cat
, real
, imag
,
conj
, isreal
, etc.
Addressing some components of an array R of rationals with their
linearized indices can be done using the syntax R(k,0) where
k is the vector of linearized indices, and 0 is used instead of
j or higher order indices. |
例
s=poly(0,'s'); W=[1/s,1/(s+1)] W'*W Num=[s,s+2;1,s];Den=[s*s,s;s,s*s]; rlist(Num,Den,[]) H=Num./Den syslin('c',Num,Den) syslin('c',H) [Num1,Den1]=simp(Num,Den)
--> R = (1-%s).^[1 0 2] ./ %s.^[1 2 0] R = 2 1 - s 1 1 - 2s + s ------ -- ----------- 2 s s 1 --> horner(R,[-1 0 2 -2]') ans = -2. 1. 4. Inf Inf 1. -0.5 0.25 1. -1.5 0.25 9. --> R = (1-%s)/(1+%s) R = 1 - s ------ 1 + s --> horner(R, 1-%z^2) ans = 2 z ------ 2 2 - z
参照
履歴
バージョン | 記述 |
6.0.2 | The syntax R(k,0) is now available to address components
with their linearized indices k. |
Report an issue | ||
<< poly | Polynomials | residu >> |