<?xml version="1.0" encoding="UTF-8"?>

<!--
 * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
 * Copyright (C) 2008 - INRIA - Serge STEER
 *
 * 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:ns5="http://www.w3.org/1999/xhtml" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" xml:id="ind2sub" xml:lang="ja">

    <refnamediv>

        <refname>ind2sub</refname>

        <refpurpose>線形添字を添字付き行列に変換</refpurpose>

    </refnamediv>

    <refsynopsisdiv>

        <title>呼び出し手順</title>

        <synopsis>[i1,i2,..] =ind2sub(dims,I)

            Mi = ind2sub(dims,I)

        </synopsis>

    </refsynopsisdiv>

    <refsection>

        <title>引数</title>

        <variablelist>

            <varlistentry>

                <term>dims</term>

                <listitem>

                    <para>ベクトル: 行列の次元</para>

                </listitem>

            </varlistentry>

            <varlistentry>

                <term>I</term>

                <listitem>

                    <para>ベクトル: 指定した線形添字</para>

                </listitem>

            </varlistentry>

            <varlistentry>

                <term>i1,i2,..</term>

                <listitem>

                    <para>

                        添字値 (<literal>I</literal>と同じ形の行列)

                    </para>

                </listitem>

            </varlistentry>

            <varlistentry>

                <term>Mi</term>

                <listitem>

                    <para>列に添字値を含む行列.</para>

                </listitem>

            </varlistentry>

        </variablelist>

    </refsection>

    <refsection>

        <title>説明</title>

        <para>

            <literal>ind2sub</literal> は指定した配列への添字と

            等価な添字値を定義する際に使用されます.

            <literal>[i1,i2,..] = ind2sub(dims,I)</literal> は配列

            <literal>i1</literal>, <literal>i2</literal>, ... を返します.

            この配列には,

            大きさ<literal>dims</literal>の行列に関する添字行列<literal>I</literal>

            の等価な行,列, ... 添字が含まれます.

            <literal>Mi=ind2sub(dims,I)</literal> は行列

            <literal>Mi</literal> を返します.

            この行列の列は配列

            <literal>i1(:)</literal>, <literal>i2(:)</literal>, ...となります.

        </para>

    </refsection>

    <refsection>

        <title>例</title>

        <programlisting role="example"><![CDATA[
ind2sub([2,3,2],1:12)
[i,j,k]=ind2sub([2,3,2],1:12)
 ]]></programlisting>

    </refsection>

    <refsection role="see also">

        <title>参照</title>

        <simplelist type="inline">

            <member>

                <link linkend="sub2ind">sub2ind</link>

            </member>

            <member>

                <link linkend="extraction">extraction</link>

            </member>

            <member>

                <link linkend="insertion">insertion</link>

            </member>

        </simplelist>

    </refsection>

</refentry>

