<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://qetlab.com/wiki/index.php?action=history&amp;feed=atom&amp;title=Pad_array</id>
	<title>Pad array - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://qetlab.com/wiki/index.php?action=history&amp;feed=atom&amp;title=Pad_array"/>
	<link rel="alternate" type="text/html" href="https://qetlab.com/wiki/index.php?title=Pad_array&amp;action=history"/>
	<updated>2026-08-07T14:41:00Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.45.3</generator>
	<entry>
		<id>https://qetlab.com/wiki/index.php?title=Pad_array&amp;diff=929&amp;oldid=prev</id>
		<title>Rmmateri: /* Examples */</title>
		<link rel="alternate" type="text/html" href="https://qetlab.com/wiki/index.php?title=Pad_array&amp;diff=929&amp;oldid=prev"/>
		<updated>2018-07-18T16:22:28Z</updated>

		<summary type="html">&lt;p&gt;&lt;span class=&quot;autocomment&quot;&gt;Examples&lt;/span&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 16:22, 18 July 2018&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l16&quot;&gt;Line 16:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 16:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* &amp;lt;tt&amp;gt;DIR&amp;lt;/tt&amp;gt;: An integer specifying whether to prepend or postpend the zeroes onto &amp;lt;tt&amp;gt;ARR&amp;lt;/tt&amp;gt;. 0 means to prepend, 1 means to postpend, and any other number will throw an error.  &lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* &amp;lt;tt&amp;gt;DIR&amp;lt;/tt&amp;gt;: An integer specifying whether to prepend or postpend the zeroes onto &amp;lt;tt&amp;gt;ARR&amp;lt;/tt&amp;gt;. 0 means to prepend, 1 means to postpend, and any other number will throw an error.  &lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;==Examples==&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;==Examples==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Some &lt;/del&gt;basic &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;examples &lt;/del&gt;of how pad_array works.  &lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;A &lt;/ins&gt;basic &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;example &lt;/ins&gt;of how pad_array works.  &lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;syntaxhighlight&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;syntaxhighlight&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;gt;&amp;gt; arr = [1,2,3,4];&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;gt;&amp;gt; arr = [1,2,3,4];&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Rmmateri</name></author>
	</entry>
	<entry>
		<id>https://qetlab.com/wiki/index.php?title=Pad_array&amp;diff=928&amp;oldid=prev</id>
		<title>Rmmateri: Created page with &quot;{{Function |name=pad_array |desc=Pads an array with zeroes in a similar way to padarray in MATLAB. |cat=Helper functions |upd=July 18th,...&quot;</title>
		<link rel="alternate" type="text/html" href="https://qetlab.com/wiki/index.php?title=Pad_array&amp;diff=928&amp;oldid=prev"/>
		<updated>2018-07-18T16:21:49Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;{{Function |name=pad_array |desc=Pads an array with zeroes in a similar way to padarray in MATLAB. |cat=&lt;a href=&quot;/List_of_functions#Helper_functions&quot; title=&quot;List of functions&quot;&gt;Helper functions&lt;/a&gt; |upd=July 18th,...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{{Function&lt;br /&gt;
|name=pad_array&lt;br /&gt;
|desc=Pads an array with zeroes in a similar way to padarray in MATLAB.&lt;br /&gt;
|cat=[[List of functions#Helper_functions|Helper functions]]&lt;br /&gt;
|upd=July 18th, 2018&lt;br /&gt;
|v=0.50&lt;br /&gt;
|helper=1}}&lt;br /&gt;
&amp;lt;tt&amp;gt;&amp;#039;&amp;#039;&amp;#039;pad_array&amp;#039;&amp;#039;&amp;#039;&amp;lt;/tt&amp;gt; is a [[List of functions|function]] that takes an array and either prepends or postpends a number of zeroes specified by the function call. &lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
* &amp;lt;tt&amp;gt;BIN = pad_array(ARR, PAD_NUM, DIR)&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Argument descriptions==&lt;br /&gt;
* &amp;lt;tt&amp;gt;ARR&amp;lt;/tt&amp;gt;: The array which will have zeroes padded onto it.&lt;br /&gt;
* &amp;lt;tt&amp;gt;PAD_NUM&amp;lt;/tt&amp;gt;: The number of zeroes to either prepend or postpend onto &amp;lt;tt&amp;gt;ARR&amp;lt;/tt&amp;gt;. This must be a non-negative integer.&lt;br /&gt;
* &amp;lt;tt&amp;gt;DIR&amp;lt;/tt&amp;gt;: An integer specifying whether to prepend or postpend the zeroes onto &amp;lt;tt&amp;gt;ARR&amp;lt;/tt&amp;gt;. 0 means to prepend, 1 means to postpend, and any other number will throw an error. &lt;br /&gt;
==Examples==&lt;br /&gt;
Some basic examples of how pad_array works. &lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;gt;&amp;gt; arr = [1,2,3,4];&lt;br /&gt;
&amp;gt;&amp;gt; pad_array(arr, 2, 0)&lt;br /&gt;
&lt;br /&gt;
ans =&lt;br /&gt;
&lt;br /&gt;
     0     0     1     2     3     4&lt;br /&gt;
&lt;br /&gt;
&amp;gt;&amp;gt; pad_array(arr, 2, 1)&lt;br /&gt;
&lt;br /&gt;
ans =&lt;br /&gt;
&lt;br /&gt;
     1     2     3     4     0     0&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Notes==&lt;br /&gt;
This function is only meant to simplify code within other functions without the need to install the image processing package of MATLAB or Octave-Forge. Note that this function only pads with zeroes. If other numbers are required, please use the `padarray&amp;#039; function within the image processing toolbox of MATLAB or Octave-Forge. &lt;br /&gt;
&lt;br /&gt;
{{SourceCode|name=iden|helper=1}}&lt;/div&gt;</summary>
		<author><name>Rmmateri</name></author>
	</entry>
</feed>