Sophie

Sophie

distrib > Mandriva > 2010.0 > i586 > media > contrib-release > by-pkgid > 3e60ff9d4d6f58c8fbd17208f14089fa > files > 313

octave-doc-3.2.3-3mdv2010.0.i586.rpm

<html lang="en">
<head>
<title>Output Conversion for Matrices - Untitled</title>
<meta http-equiv="Content-Type" content="text/html">
<meta name="description" content="Untitled">
<meta name="generator" content="makeinfo 4.13">
<link title="Top" rel="start" href="index.html#Top">
<link rel="up" href="C_002dStyle-I_002fO-Functions.html#C_002dStyle-I_002fO-Functions" title="C-Style I/O Functions">
<link rel="prev" href="Formatted-Output.html#Formatted-Output" title="Formatted Output">
<link rel="next" href="Output-Conversion-Syntax.html#Output-Conversion-Syntax" title="Output Conversion Syntax">
<link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage">
<meta http-equiv="Content-Style-Type" content="text/css">
<style type="text/css"><!--
  pre.display { font-family:inherit }
  pre.format  { font-family:inherit }
  pre.smalldisplay { font-family:inherit; font-size:smaller }
  pre.smallformat  { font-family:inherit; font-size:smaller }
  pre.smallexample { font-size:smaller }
  pre.smalllisp    { font-size:smaller }
  span.sc    { font-variant:small-caps }
  span.roman { font-family:serif; font-weight:normal; } 
  span.sansserif { font-family:sans-serif; font-weight:normal; } 
--></style>
</head>
<body>
<div class="node">
<a name="Output-Conversion-for-Matrices"></a>
<p>
Next:&nbsp;<a rel="next" accesskey="n" href="Output-Conversion-Syntax.html#Output-Conversion-Syntax">Output Conversion Syntax</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="Formatted-Output.html#Formatted-Output">Formatted Output</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="C_002dStyle-I_002fO-Functions.html#C_002dStyle-I_002fO-Functions">C-Style I/O Functions</a>
<hr>
</div>

<h4 class="subsection">14.2.5 Output Conversion for Matrices</h4>

<p>When given a matrix value, Octave's formatted output functions cycle
through the format template until all the values in the matrix have been
printed.  For example,

<pre class="example">     printf ("%4.2f %10.2e %8.4g\n", hilb (3));
     
          -| 1.00   5.00e-01   0.3333
          -| 0.50   3.33e-01     0.25
          -| 0.33   2.50e-01      0.2
</pre>
   <p>If more than one value is to be printed in a single call, the output
functions do not return to the beginning of the format template when
moving on from one value to the next.  This can lead to confusing output
if the number of elements in the matrices are not exact multiples of the
number of conversions in the format template.  For example,

<pre class="example">     printf ("%4.2f %10.2e %8.4g\n", [1, 2], [3, 4]);
     
          -| 1.00   2.00e+00        3
          -| 4.00
</pre>
   <p>If this is not what you want, use a series of calls instead of just one.

   </body></html>