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

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

    <refnamediv>

        <refname>ismatrix</refname>

        <refpurpose>変数が行列かどうかを確認</refpurpose>

    </refnamediv>

    <refsynopsisdiv>

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

        <synopsis>tf = ismatrix(x)</synopsis>

    </refsynopsisdiv>

    <refsection>

        <title>引数</title>

        <variablelist>

            <varlistentry>

                <term>x</term>

                <listitem>

                    <para>スカラー,ベクトル, 行列, ハイパー行列, リスト, 構造体の配列またはセル</para>

                </listitem>

            </varlistentry>

            <varlistentry>

                <term>tf</term>

                <listitem>

                    <para>論理値</para>

                </listitem>

            </varlistentry>

        </variablelist>

    </refsection>

    <refsection>

        <title>説明</title>

        <para>

            <literal>

                ismatrix(<varname>x</varname>)

            </literal>
            は,
            <varname>x</varname>が行列の場合にtrueを返します.
            スカラーとベクトルは行列とみなされます.
        </para>
        <note>
          <itemizedlist>
            <listitem>
               An hypermatrix H that would be a matrix after reordering its dimensions is
               considered as a matrix, and <literal>ismatrix(H)</literal> returns <constant>%T</constant>.
            </listitem>
            <listitem>
              To test that <varname>x</varname> is not an hypermatrix or an hyperarray -- whatever
              are the sizes of its dimensions --, use simply <literal>ndims(x)&lt;3</literal>.
            </listitem>
            <listitem>
              <literal>ismatrix([])</literal>はfalseを返します.
            </listitem>
          </itemizedlist>
        </note>
    </refsection>

    <refsection>

        <title>例</title>

        <programlisting role="example"><![CDATA[
ismatrix(ones(10,5))
ismatrix(1)
ismatrix(["s" "t" "u"; "t" "s" "u"])
ismatrix(rand(2,1,3)) // 要素が1
ismatrix(rand(2,2,3)) // ハイパー行列
s = struct();
ismatrix(s) // 空の構造体
clear s
s(1,2).a = 3;
s(1,3).b = %z;
ismatrix(s) // 構造体の行配列
clear s
s(2,1).a = "w";
s(3,1).b = %t;
iscolumn(s) // 構造体の列配列
clear s
s(1,2).a = -2;
s(3,1).b = %pi;
ismatrix(s) // 構造体の2次元非正方行列
clear s
s(2,1,2).a = 3;
s(1,1,2).b = "test";
ismatrix(s) // 構造体の3次元配列 (1要素の次元が1つある)
clear s
s(1,1,2).a = 3;
s(1,1,3).b = "test";
ismatrix(s) // 構造体の3次元配列 (1要素の次元が2つある)
clear s
s(2,2,2).a = %f;
s(1,2,1).b = list(%e, %s);
ismatrix(s) // 構造体の3次元 (立法)配列
 ]]></programlisting>

    </refsection>

    <refsection role="see also">

        <title>参照</title>

        <simplelist type="inline">

            <member>

                <link linkend="isscalar">isscalar</link>

            </member>

            <member>

                <link linkend="isrow">isrow</link>

            </member>

            <member>

                <link linkend="iscolumn">iscolumn</link>

            </member>

            <member>

                <link linkend="issquare">issquare</link>

            </member>

            <member>
                <link linkend="isempty">isempty</link>
            </member>
            <member>
                <link linkend="ndims">ndims</link>
            </member>

        </simplelist>

    </refsection>

    <refsection>

        <title>履歴</title>

        <revhistory>

            <revision>

                <revnumber>5.5.0</revnumber>

                <revremark>関数 ismatrix が導入されました.</revremark>

            </revision>

        </revhistory>

    </refsection>

</refentry>

