<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Calculation of the mean in an Array in Mathcad</title>
    <link>https://www.ptcusercommunity.com/t5/Mathcad/Calculation-of-the-mean-in-an-Array/m-p/732742#M196180</link>
    <description>&lt;P&gt;You do realise that the result of this operation produces an array that has one less elements...?&lt;/P&gt;
&lt;P&gt;This is one way to do it:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="LucMeekes_0-1623087614384.png" style="width: 400px;"&gt;&lt;img src="https://www.ptcusercommunity.com/t5/image/serverpage/image-id/42501iD08221AAED8D994C/image-size/medium?v=v2&amp;amp;px=400" role="button" title="LucMeekes_0-1623087614384.png" alt="LucMeekes_0-1623087614384.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;The result for your array is:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="LucMeekes_1-1623087632025.png" style="width: 400px;"&gt;&lt;img src="https://www.ptcusercommunity.com/t5/image/serverpage/image-id/42502i5079320191769B74/image-size/medium?v=v2&amp;amp;px=400" role="button" title="LucMeekes_1-1623087632025.png" alt="LucMeekes_1-1623087632025.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;There's also a built-in function for it: Moving average. Try:&lt;/P&gt;
&lt;P&gt;movavg(Ri,2)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Success!&lt;BR /&gt;Luc&lt;/P&gt;</description>
    <pubDate>Mon, 07 Jun 2021 17:54:32 GMT</pubDate>
    <dc:creator>LucMeekes</dc:creator>
    <dc:date>2021-06-07T17:54:32Z</dc:date>
    <item>
      <title>Calculation of the mean in an Array</title>
      <link>https://www.ptcusercommunity.com/t5/Mathcad/Calculation-of-the-mean-in-an-Array/m-p/732737#M196179</link>
      <description>&lt;P&gt;Hi,&lt;BR /&gt;&lt;BR /&gt;I have a simple Problem however I'm searching since nearly one hour for the solution.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;I'm looking to calculate the mean in an Array. I Have R=(x1, x2, ....) and i want to calculate the mean of every value in the Array like Rm1=(x1+x2)/2 Rm2=(x2+x3)/2 ... and so on.&amp;nbsp;&lt;BR /&gt;How does it work im Mathcad? The normal Matrix Indicies with i and i+1 doesn't work.&lt;BR /&gt;&lt;BR /&gt;I also attached a short Version of the Mathcad file, especially to focus on this Problem. Thanks for helping&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":smiling_face_with_smiling_eyes:"&gt;😊&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 07 Jun 2021 16:38:00 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/Mathcad/Calculation-of-the-mean-in-an-Array/m-p/732737#M196179</guid>
      <dc:creator>DG_8871348</dc:creator>
      <dc:date>2021-06-07T16:38:00Z</dc:date>
    </item>
    <item>
      <title>Re: Calculation of the mean in an Array</title>
      <link>https://www.ptcusercommunity.com/t5/Mathcad/Calculation-of-the-mean-in-an-Array/m-p/732742#M196180</link>
      <description>&lt;P&gt;You do realise that the result of this operation produces an array that has one less elements...?&lt;/P&gt;
&lt;P&gt;This is one way to do it:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="LucMeekes_0-1623087614384.png" style="width: 400px;"&gt;&lt;img src="https://www.ptcusercommunity.com/t5/image/serverpage/image-id/42501iD08221AAED8D994C/image-size/medium?v=v2&amp;amp;px=400" role="button" title="LucMeekes_0-1623087614384.png" alt="LucMeekes_0-1623087614384.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;The result for your array is:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="LucMeekes_1-1623087632025.png" style="width: 400px;"&gt;&lt;img src="https://www.ptcusercommunity.com/t5/image/serverpage/image-id/42502i5079320191769B74/image-size/medium?v=v2&amp;amp;px=400" role="button" title="LucMeekes_1-1623087632025.png" alt="LucMeekes_1-1623087632025.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;There's also a built-in function for it: Moving average. Try:&lt;/P&gt;
&lt;P&gt;movavg(Ri,2)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Success!&lt;BR /&gt;Luc&lt;/P&gt;</description>
      <pubDate>Mon, 07 Jun 2021 17:54:32 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/Mathcad/Calculation-of-the-mean-in-an-Array/m-p/732742#M196180</guid>
      <dc:creator>LucMeekes</dc:creator>
      <dc:date>2021-06-07T17:54:32Z</dc:date>
    </item>
    <item>
      <title>Re: Calculation of the mean in an Array</title>
      <link>https://www.ptcusercommunity.com/t5/Mathcad/Calculation-of-the-mean-in-an-Array/m-p/732744#M196181</link>
      <description>&lt;P&gt;Thanks for the fast Reply. &lt;BR /&gt;But is there any shorter and easier Solution for this Problem without Programming?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 07 Jun 2021 18:00:41 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/Mathcad/Calculation-of-the-mean-in-an-Array/m-p/732744#M196181</guid>
      <dc:creator>DG_8871348</dc:creator>
      <dc:date>2021-06-07T18:00:41Z</dc:date>
    </item>
    <item>
      <title>Re: Calculation of the mean in an Array</title>
      <link>https://www.ptcusercommunity.com/t5/Mathcad/Calculation-of-the-mean-in-an-Array/m-p/732747#M196182</link>
      <description>&lt;P&gt;Look again to my post: movavg is built in.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Success!&lt;/P&gt;
&lt;P&gt;Luc&lt;/P&gt;</description>
      <pubDate>Mon, 07 Jun 2021 18:04:51 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/Mathcad/Calculation-of-the-mean-in-an-Array/m-p/732747#M196182</guid>
      <dc:creator>LucMeekes</dc:creator>
      <dc:date>2021-06-07T18:04:51Z</dc:date>
    </item>
    <item>
      <title>Re: Calculation of the mean in an Array</title>
      <link>https://www.ptcusercommunity.com/t5/Mathcad/Calculation-of-the-mean-in-an-Array/m-p/732780#M196187</link>
      <description>&lt;P&gt;Here is your own approach using a range variable, but as the last element of the vector has no successor, the range to use must run only up to Anz.i-1 and so you can't use i, you need a new range variable - k in my example (but of course you also could redefine i for that purpose).&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Werner_E_0-1623109570282.png" style="width: 400px;"&gt;&lt;img src="https://www.ptcusercommunity.com/t5/image/serverpage/image-id/42510i0283BD3AAF5FAC3A/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Werner_E_0-1623109570282.png" alt="Werner_E_0-1623109570282.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Nonetheless I would prefer defining a small utility function&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Werner_E_1-1623110010341.png" style="width: 999px;"&gt;&lt;img src="https://www.ptcusercommunity.com/t5/image/serverpage/image-id/42511i3D89C289AC0BD415/image-size/large?v=v2&amp;amp;px=999" role="button" title="Werner_E_1-1623110010341.png" alt="Werner_E_1-1623110010341.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;But is there any shorter and easier Solution for this Problem without Programming?&amp;nbsp;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Luc's "Mean2" function IS quite short (and can be written even a little bit shorter if you assume ORIGIN=0) does NOT use programming (so it could be used in the free Express version of Prime, too).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The built-in function "movavg" suggested by Luc makes the same calculations but always returns a vector of the same length by prepending first vector element.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Werner_E_2-1623110134820.png" style="width: 278px;"&gt;&lt;img src="https://www.ptcusercommunity.com/t5/image/serverpage/image-id/42512iF6C2B1ED439DF54F/image-dimensions/278x174?v=v2" width="278" height="174" role="button" title="Werner_E_2-1623110134820.png" alt="Werner_E_2-1623110134820.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;To get rid of it you may use the "submatrix" command&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Werner_E_3-1623110198205.png" style="width: 509px;"&gt;&lt;img src="https://www.ptcusercommunity.com/t5/image/serverpage/image-id/42513i1FBD56C4C63BDD5C/image-dimensions/509x143?v=v2" width="509" height="143" role="button" title="Werner_E_3-1623110198205.png" alt="Werner_E_3-1623110198205.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;(assuming ORIGIN=0 as is the case in your sheet).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 08 Jun 2021 09:05:02 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/Mathcad/Calculation-of-the-mean-in-an-Array/m-p/732780#M196187</guid>
      <dc:creator>Werner_E</dc:creator>
      <dc:date>2021-06-08T09:05:02Z</dc:date>
    </item>
    <item>
      <title>Re: Calculation of the mean in an Array</title>
      <link>https://www.ptcusercommunity.com/t5/Mathcad/Calculation-of-the-mean-in-an-Array/m-p/732947#M196191</link>
      <description>&lt;P&gt;Thanks, the first Example was the Perfect Solution&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":smiling_face_with_sunglasses:"&gt;😎&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 08 Jun 2021 21:17:46 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/Mathcad/Calculation-of-the-mean-in-an-Array/m-p/732947#M196191</guid>
      <dc:creator>DG_8871348</dc:creator>
      <dc:date>2021-06-08T21:17:46Z</dc:date>
    </item>
  </channel>
</rss>

