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

<!--
 * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
 * Copyright (C) 2008 - 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: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="ones" xml:lang="ja">

    <refnamediv>

        <refname>ones</refname>

        <refpurpose>要素が1の行列</refpurpose>

    </refnamediv>

    <refsynopsisdiv>

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

        <synopsis>y=ones(m1,m2,...)

            y=ones(x)

            y=ones()

        </synopsis>

    </refsynopsisdiv>

    <refsection>

        <title>引数</title>

        <variablelist>

            <varlistentry>

                <term>x,y</term>

                <listitem>

                    <para>行列</para>

                </listitem>

            </varlistentry>

            <varlistentry>

                <term>m1, m2,..</term>

                <listitem>

                    <para>整数</para>

                </listitem>

            </varlistentry>

        </variablelist>

    </refsection>

    <refsection>

        <title>説明</title>

        <para>要素が1の行列を返します.</para>

        <variablelist>

            <varlistentry>

                <term>ones(m1,m2)</term>

                <listitem>

                    <para>

                        全て1からなる<literal>(m1,m2)</literal> 行列を返します.

                    </para>

                </listitem>

            </varlistentry>

            <varlistentry>

                <term>ones(m1,m2,..,mn)</term>

                <listitem>

                    <para>

                        全て1からなる<literal>(m1,m2,..,mn)</literal> 行列を作成します.

                    </para>

                </listitem>

            </varlistentry>

            <varlistentry>

                <term>ones(x)</term>

                <listitem>

                    <para>

                        <literal>x</literal>と同じ大きさで全て1からなる行列を返します.

                    </para>

                </listitem>

            </varlistentry>

            <varlistentry>

                <term>ones(x)</term>

                <listitem>

                    <para>

                        は <literal>x</literal> が

                        <literal>syslin</literal> リストの場合でも有効です.

                    </para>

                </listitem>

            </varlistentry>

        </variablelist>

    </refsection>

    <refsection>

        <title>注意</title>

        <itemizedlist>

            <listitem>

                <para>

                    <literal>ones(3)</literal> は <literal>a=3</literal> を指定した

                    <literal>ones(a)</literal>, すなわち, 3x3 行列ではないことに注意してください!

                </para>

            </listitem>

            <listitem>

                <para>ones() は ones(1,1)と等価です.</para>

            </listitem>

            <listitem>

                <para>

                    <literal>ones(3,-3)</literal> および <literal>ones(-3,-3)</literal> は

                    共に空の行列を返します.

                </para>

            </listitem>

        </itemizedlist>
        <note>
           <literal>repmat(1, sizes)</literal> can be used to generate an array of ones with
           <literal>sizes=[m1 m2 ..]</literal> given as a vector.
        </note>

    </refsection>

    <refsection>

        <title>例</title>

        <programlisting role="example"><![CDATA[
ones(3)
ones(3,3)
ones(2,3,2)

repmat(1, [2 4 2])
 ]]></programlisting>

    </refsection>

    <refsection role="see also">

        <title>参照</title>

        <simplelist type="inline">

            <member>

                <link linkend="eye">eye</link>

            </member>

            <member>

                <link linkend="zeros">zeros</link>

            </member>

        </simplelist>

    </refsection>

</refentry>

