<?xml version="1.0" encoding="UTF-8"?>
<!--
 * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
 * Copyright (C) INRIA -
 * Copyright (C) 2012 - 2016 - Scilab Enterprises
 *
 * This file is hereby licensed under the terms of the GNU GPL v2.0,
 * pursuant to article 5.3.4 of the CeCILL v.2.1.
 * This file was originally licensed under the terms of the CeCILL v2.1,
 * and continues to be available under such terms.
 * For more information, see the COPYING file which you should have received
 * along with this program.
 *
 -->
<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink"
          xmlns:svg="http://www.w3.org/2000/svg" xmlns:mml="http://www.w3.org/1998/Math/MathML"
          xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org"
          xml:lang="en" xml:id="abcd">
    <refnamediv>
        <refname>abcd</refname>
        <refpurpose>state-space matrices</refpurpose>
    </refnamediv>
    <refsynopsisdiv>
        <title>Syntax</title>
        <synopsis>[A,B,C,D] = abcd(sl)</synopsis>
    </refsynopsisdiv>
    <refsection>
        <title>Arguments</title>
        <variablelist>
            <varlistentry>
                <term>sl</term>
                <listitem>
                    <para>
                        linear system (<literal>syslin</literal> list) in state-space or transfer form
                    </para>
                </listitem>
            </varlistentry>
            <varlistentry>
                <term>A,B,C,D</term>
                <listitem>
                    <para>real matrices of appropriate dimensions</para>
                </listitem>
            </varlistentry>
        </variablelist>
    </refsection>
    <refsection>
        <title>Description</title>
        <para>
            returns the <literal>A,B,C,D</literal> matrices from a linear system <literal>Sl</literal>.
        </para>
        <para>
            Utility function. For transfer matrices <literal>Sl</literal> is converted
            into state-space form by <literal>tf2ss</literal>.
        </para>
        <para>
            The matrices <literal>A,B,C,D</literal> are the elements <literal>2</literal> to <literal>5</literal> of
            the <literal>syslin</literal> list <literal>Sl</literal>, i.e. <literal>[A,B,C,D] = Sl(2:5)</literal> .
        </para>
    </refsection>
    <refsection>
        <title>Examples</title>
        <programlisting role="example"><![CDATA[
A=diag([1,2,3]);B=[1;1;1];C=[2,2,2];
sys=syslin('c',A,B,C);
sys("A")
sys("C")
[A1,B1,C1,D1]=abcd(sys);
A1
systf=ss2tf(sys);
[a,b,c,d]=abcd(systf)
spec(a)
c*b-C*B
c*a*b-C*A*B
 ]]></programlisting>
    </refsection>
    <refsection role="see also">
        <title>See also</title>
        <simplelist type="inline">
            <member>
                <link linkend="syslin">syslin</link>
            </member>
            <member>
                <link linkend="ssrand">ssrand</link>
            </member>
        </simplelist>
    </refsection>
</refentry>
