13
13
<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" version="5.0-subset Scilab" xml:id="resize_matrix" xml:lang="en">
15
<refname>resize_matrix</refname>
16
<refpurpose>create a new matrix with a different size</refpurpose>
19
<title>Calling Sequence</title>
20
<synopsis>resMat = resize_matrix(mat,nbRow,nbCol,[typeOfMat])</synopsis>
23
<title>Arguments</title>
28
<para>input matrix from which the resized matrix will be
36
<para>number of row of the resized matrix.</para>
42
<para>number of column of the resized matrix.</para>
46
<term>typeOfMat</term>
48
<para>caracter string, type name of the resized matrix.</para>
54
<para>resized matrix.</para>
60
<title>Description</title>
62
Create a matrix of size <literal>nbRow</literal> x
63
<literal>nbCol</literal> and whose elements <literal>(i,j)</literal> are
64
<literal>mat(i,j)</literal> if <literal>(i,j)</literal> is in the range of
65
the input matrix. Otherwise elements <literal>(i,j)</literal> are
66
<literal>0</literal> for real or integer matrices, <literal>%f</literal>
67
for boolean matrices and an empty string for string matrices.
69
<para>The type of the output matrix may be modified by specifying the
70
<literal>typeOfMat</literal> argument. In this case, be sure that the
71
input matrix type is compatible with this one.
73
<para>For now, only real, integer matrices, boolean and character string
74
matrices are supported. This means that <literal>typeOfMat</literal> must
75
be chosen within: 'constant', 'boolean', 'string' or any integer type
76
('int8', 'int16',...).
80
<title>Examples</title>
81
<programlisting role="example"><![CDATA[
15
<refname>resize_matrix</refname>
16
<refpurpose>create a new matrix with a different size</refpurpose>
19
<title>Calling Sequence</title>
20
<synopsis>resMat = resize_matrix(mat,nbRow,nbCol,[typeOfMat])</synopsis>
23
<title>Arguments</title>
28
<para>input matrix from which the resized matrix will be
36
<para>number of row of the resized matrix.</para>
42
<para>number of column of the resized matrix.</para>
46
<term>typeOfMat</term>
48
<para>caracter string, type name of the resized matrix.</para>
54
<para>resized matrix.</para>
60
<title>Description</title>
62
Create a matrix of size <literal>nbRow</literal> x
63
<literal>nbCol</literal> and whose elements <literal>(i,j)</literal> are
64
<literal>mat(i,j)</literal> if <literal>(i,j)</literal> is in the range of
65
the input matrix. Otherwise elements <literal>(i,j)</literal> are
66
<literal>0</literal> for real or integer matrices, <literal>%f</literal>
67
for boolean matrices and an empty string for string matrices.
69
<para>The type of the output matrix may be modified by specifying the
70
<literal>typeOfMat</literal> argument. In this case, be sure that the
71
input matrix type is compatible with this one.
73
<para>For now, only real, integer matrices, boolean and character string
74
matrices are supported. This means that <literal>typeOfMat</literal> must
75
be chosen within: 'constant', 'boolean', 'string' or any integer type
76
('int8', 'int16',...).
80
<title>Examples</title>
81
<programlisting role="example"><![CDATA[
83
83
myMat = 5 * rand( 3, 4 )
84
84
myMat = resize_matrix( myMat, 3, 3 ) // reduce the matrix size
90
90
myMatString = ["Scilab","the";"Open Source","Scientific";"Software","Package"]
91
91
myMatString = resize_matrix( myMatString, 3, 1 )
92
92
]]></programlisting>
94
<refsection role="see also">
95
<title>See Also</title>
96
<simplelist type="inline">
98
<link linkend="matrix">matrix</link>
101
<link linkend="size">size</link>
104
<link linkend="typeof">typeof</link>
94
<refsection role="see also">
95
<title>See Also</title>
96
<simplelist type="inline">
98
<link linkend="matrix">matrix</link>
101
<link linkend="size">size</link>
104
<link linkend="typeof">typeof</link>