<?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 Finding the average value in Mathcad</title>
    <link>https://www.ptcusercommunity.com/t5/Mathcad/Finding-the-average-value/m-p/949118#M211756</link>
    <description>&lt;P&gt;qc is determined in each z point . I need to find the average of qc in each layer . the layer thickness is dz&amp;nbsp;&lt;/P&gt;&lt;P&gt;I need mathcad to find the average values of qc that correspond to dz values&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="YA_10963798_0-1715408118548.png" style="width: 400px;"&gt;&lt;img src="https://www.ptcusercommunity.com/t5/image/serverpage/image-id/104075i981FAA016F60B1CE/image-size/medium?v=v2&amp;amp;px=400" role="button" title="YA_10963798_0-1715408118548.png" alt="YA_10963798_0-1715408118548.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sat, 11 May 2024 06:16:43 GMT</pubDate>
    <dc:creator>YA_10963798</dc:creator>
    <dc:date>2024-05-11T06:16:43Z</dc:date>
    <item>
      <title>Finding the average value</title>
      <link>https://www.ptcusercommunity.com/t5/Mathcad/Finding-the-average-value/m-p/949118#M211756</link>
      <description>&lt;P&gt;qc is determined in each z point . I need to find the average of qc in each layer . the layer thickness is dz&amp;nbsp;&lt;/P&gt;&lt;P&gt;I need mathcad to find the average values of qc that correspond to dz values&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="YA_10963798_0-1715408118548.png" style="width: 400px;"&gt;&lt;img src="https://www.ptcusercommunity.com/t5/image/serverpage/image-id/104075i981FAA016F60B1CE/image-size/medium?v=v2&amp;amp;px=400" role="button" title="YA_10963798_0-1715408118548.png" alt="YA_10963798_0-1715408118548.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 11 May 2024 06:16:43 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/Mathcad/Finding-the-average-value/m-p/949118#M211756</guid>
      <dc:creator>YA_10963798</dc:creator>
      <dc:date>2024-05-11T06:16:43Z</dc:date>
    </item>
    <item>
      <title>Re: Finding the average value</title>
      <link>https://www.ptcusercommunity.com/t5/Mathcad/Finding-the-average-value/m-p/949119#M211757</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;I am limited to Expresss so can only solve using subscripted vectors and matrices.&lt;/P&gt;
&lt;P&gt;Enclosed is worksheet that gets the averages.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Cheers&lt;/P&gt;
&lt;P&gt;Terry&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 11 May 2024 08:43:31 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/Mathcad/Finding-the-average-value/m-p/949119#M211757</guid>
      <dc:creator>terryhendicott</dc:creator>
      <dc:date>2024-05-11T08:43:31Z</dc:date>
    </item>
    <item>
      <title>Re: Finding the average value</title>
      <link>https://www.ptcusercommunity.com/t5/Mathcad/Finding-the-average-value/m-p/949134#M211761</link>
      <description>&lt;P&gt;thank you for your help&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 11 May 2024 13:21:22 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/Mathcad/Finding-the-average-value/m-p/949134#M211761</guid>
      <dc:creator>YA_10963798</dc:creator>
      <dc:date>2024-05-11T13:21:22Z</dc:date>
    </item>
    <item>
      <title>Re: Finding the average value</title>
      <link>https://www.ptcusercommunity.com/t5/Mathcad/Finding-the-average-value/m-p/949140#M211762</link>
      <description>&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="YA_10963798_0-1715436336783.png" style="width: 400px;"&gt;&lt;img src="https://www.ptcusercommunity.com/t5/image/serverpage/image-id/104087i249401018633EFBB/image-size/medium?v=v2&amp;amp;px=400" role="button" title="YA_10963798_0-1715436336783.png" alt="YA_10963798_0-1715436336783.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Why do you think I'm having this error although I just followed your sheet ?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 11 May 2024 14:06:34 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/Mathcad/Finding-the-average-value/m-p/949140#M211762</guid>
      <dc:creator>YA_10963798</dc:creator>
      <dc:date>2024-05-11T14:06:34Z</dc:date>
    </item>
    <item>
      <title>Re: Finding the average value</title>
      <link>https://www.ptcusercommunity.com/t5/Mathcad/Finding-the-average-value/m-p/949146#M211766</link>
      <description>&lt;P&gt;Can you upload your worksheet.&lt;/P&gt;
&lt;P&gt;Cheers&lt;/P&gt;
&lt;P&gt;Terry&lt;/P&gt;</description>
      <pubDate>Sat, 11 May 2024 20:51:39 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/Mathcad/Finding-the-average-value/m-p/949146#M211766</guid>
      <dc:creator>terryhendicott</dc:creator>
      <dc:date>2024-05-11T20:51:39Z</dc:date>
    </item>
    <item>
      <title>Re: Finding the average value</title>
      <link>https://www.ptcusercommunity.com/t5/Mathcad/Finding-the-average-value/m-p/949147#M211767</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;If you have a full license for Prime the watermark will vanish.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Cheers&lt;/P&gt;
&lt;P&gt;Terry&lt;/P&gt;</description>
      <pubDate>Sun, 12 May 2024 00:07:29 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/Mathcad/Finding-the-average-value/m-p/949147#M211767</guid>
      <dc:creator>terryhendicott</dc:creator>
      <dc:date>2024-05-12T00:07:29Z</dc:date>
    </item>
    <item>
      <title>Re: Finding the average value</title>
      <link>https://www.ptcusercommunity.com/t5/Mathcad/Finding-the-average-value/m-p/949148#M211768</link>
      <description>&lt;P&gt;sure here you are you will find the calculation on page 9&lt;/P&gt;</description>
      <pubDate>Sun, 12 May 2024 05:57:24 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/Mathcad/Finding-the-average-value/m-p/949148#M211768</guid>
      <dc:creator>YA_10963798</dc:creator>
      <dc:date>2024-05-12T05:57:24Z</dc:date>
    </item>
    <item>
      <title>Re: Finding the average value</title>
      <link>https://www.ptcusercommunity.com/t5/Mathcad/Finding-the-average-value/m-p/949149#M211769</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;See enclosed it is now calculating averages.&lt;/P&gt;
&lt;P&gt;Problem was z is previously designated as a nested matrix.&amp;nbsp; Need to define z as a single vector.&lt;/P&gt;
&lt;P&gt;Cheers&lt;/P&gt;
&lt;P&gt;Terry&lt;/P&gt;</description>
      <pubDate>Sun, 12 May 2024 08:54:20 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/Mathcad/Finding-the-average-value/m-p/949149#M211769</guid>
      <dc:creator>terryhendicott</dc:creator>
      <dc:date>2024-05-12T08:54:20Z</dc:date>
    </item>
    <item>
      <title>Re: Finding the average value</title>
      <link>https://www.ptcusercommunity.com/t5/Mathcad/Finding-the-average-value/m-p/949150#M211770</link>
      <description>&lt;DIV&gt;&lt;DIV&gt;I see&lt;/DIV&gt;&lt;DIV&gt;Thank you so much Terry.&lt;/DIV&gt;&lt;DIV&gt;I appreciate your help&lt;/DIV&gt;&lt;DIV&gt;Regards&lt;/DIV&gt;&lt;DIV&gt;Yusra&lt;/DIV&gt;&lt;BR /&gt;&lt;/DIV&gt;</description>
      <pubDate>Sun, 12 May 2024 08:56:00 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/Mathcad/Finding-the-average-value/m-p/949150#M211770</guid>
      <dc:creator>YA_10963798</dc:creator>
      <dc:date>2024-05-12T08:56:00Z</dc:date>
    </item>
    <item>
      <title>Re: Finding the average value</title>
      <link>https://www.ptcusercommunity.com/t5/Mathcad/Finding-the-average-value/m-p/1047019#M219902</link>
      <description>&lt;P&gt;Hi Terry&amp;nbsp;&lt;/P&gt;&lt;P&gt;I hope you are doing well . I know this very old question , I tried to use this function again&amp;nbsp; , but I don't know why I'm getting errors. Can you help me to fix it&amp;nbsp; &amp;gt; I couldn't upload the sheet&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;gt; BTW it works in the other sheet ok.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="YA_10963798_0-1765374846667.png" style="width: 400px;"&gt;&lt;img src="https://www.ptcusercommunity.com/t5/image/serverpage/image-id/132189iB52D6EB371BC20D1/image-size/medium?v=v2&amp;amp;px=400" role="button" title="YA_10963798_0-1765374846667.png" alt="YA_10963798_0-1765374846667.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="YA_10963798_1-1765374856796.png" style="width: 400px;"&gt;&lt;img src="https://www.ptcusercommunity.com/t5/image/serverpage/image-id/132190i91FD9B624ADADBA8/image-size/medium?v=v2&amp;amp;px=400" role="button" title="YA_10963798_1-1765374856796.png" alt="YA_10963798_1-1765374856796.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="YA_10963798_2-1765375084436.png" style="width: 400px;"&gt;&lt;img src="https://www.ptcusercommunity.com/t5/image/serverpage/image-id/132191iE5449B439E3AC870/image-size/medium?v=v2&amp;amp;px=400" role="button" title="YA_10963798_2-1765375084436.png" alt="YA_10963798_2-1765375084436.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 10 Dec 2025 13:58:25 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/Mathcad/Finding-the-average-value/m-p/1047019#M219902</guid>
      <dc:creator>YA_10963798</dc:creator>
      <dc:date>2025-12-10T13:58:25Z</dc:date>
    </item>
    <item>
      <title>Re: Finding the average value</title>
      <link>https://www.ptcusercommunity.com/t5/Mathcad/Finding-the-average-value/m-p/1047027#M219903</link>
      <description>&lt;P&gt;The last five days the forum has problems with attachments. PTC admins are informed and according to Community Manager&amp;nbsp;&lt;a href="https://www.ptcusercommunity.com/t5/user/viewprofilepage/user-id/378002"&gt;@AndrewK&lt;/a&gt;&amp;nbsp; Khoros is working to fix the problem.&lt;/P&gt;
&lt;P&gt;Its interesting that some people seem to have no problem uploading files, but others, like me and probably you, have problems doing so. I had success uploading a file in another thread after zipping it and uploading the zip archive.&lt;/P&gt;
&lt;P&gt;I just tried here and experienced the same problem. Uploading the small mcdx file failed, but packing it in an archive is a possible workaround.&amp;nbsp;&amp;nbsp;It's annoying, but it works. I hope it won't be necessary to do this for much longer.&lt;BR /&gt;&lt;a href="https://www.ptcusercommunity.com/t5/user/viewprofilepage/user-id/378002"&gt;@AndrewK&lt;/a&gt;&amp;nbsp;: Perhaps the problem and the workaround should be pointed out in “PTC Community Announcements”?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;a href="https://www.ptcusercommunity.com/t5/user/viewprofilepage/user-id/800166"&gt;@YA_10963798&lt;/a&gt;&amp;nbsp;: According to your problem - you don't show what the error message is, but chances are its a "division by zero", right?&lt;/P&gt;
&lt;P&gt;From your screenshot it looks like at least one value in your vector "ns" is zero (actually most elements in "ns" seem to be zero) and so its natural that you get an error if you use this vector in the denominator of the vectorized expression.&lt;/P&gt;
&lt;P&gt;What did you expect from&amp;nbsp; 0/0 (all elements but the first)?? What would you like to see as a result if the value in Sum is positive but the value in ns is zero (like 1/0)?&lt;/P&gt;
&lt;P&gt;You could catch the error with "try...on error ..." and return a value of your choice (maybe 0, maybe NaN) in case the division fails. For example&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Werner_E_0-1765376567210.png" style="width: 400px;"&gt;&lt;img src="https://www.ptcusercommunity.com/t5/image/serverpage/image-id/132193iA095CB301B9272C2/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Werner_E_0-1765376567210.png" alt="Werner_E_0-1765376567210.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;And you sure will want to replace 12345 for something more meaningful &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 10 Dec 2025 14:33:10 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/Mathcad/Finding-the-average-value/m-p/1047027#M219903</guid>
      <dc:creator>Werner_E</dc:creator>
      <dc:date>2025-12-10T14:33:10Z</dc:date>
    </item>
    <item>
      <title>Re: Finding the average value</title>
      <link>https://www.ptcusercommunity.com/t5/Mathcad/Finding-the-average-value/m-p/1047185#M219908</link>
      <description>&lt;P&gt;Hi Werner&amp;nbsp;&lt;/P&gt;&lt;P&gt;Okay I hope they solve the problem as soon as possible . Actually what I was trying to do is to find the average of qc in each layer ( it is a problem you helped me with previously) I wanted to compare your method to Terry's method . but I got that error ( ns is divided by zero which is true .&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can you help me to fix the program you wrote it&amp;nbsp; before for me : This is what you wrote from me&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="YA_10963798_0-1765445057356.png" style="width: 400px;"&gt;&lt;img src="https://www.ptcusercommunity.com/t5/image/serverpage/image-id/132237i9697544A2E2C7FA6/image-size/medium?v=v2&amp;amp;px=400" role="button" title="YA_10963798_0-1765445057356.png" alt="YA_10963798_0-1765445057356.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I made small changes : I changed ( Z) and q ... because an error appear ( that they should be vectors) and then change "It" to " near" .... However I got very strange values&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="YA_10963798_3-1765442334273.png" style="width: 400px;"&gt;&lt;img src="https://www.ptcusercommunity.com/t5/image/serverpage/image-id/132234i4764662790AEDEBD/image-size/medium?v=v2&amp;amp;px=400" role="button" title="YA_10963798_3-1765442334273.png" alt="YA_10963798_3-1765442334273.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It is strange because I am expecting only Qavg to be [12*1] not repeated as much as the number of z ... I hope you still remember this question when we first linked all the depths ( z) to the layer thickness (ztop) and then we found the average q in each layer .. it is the same , but now I try to do it only for one CPT and many .&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Yusra&amp;nbsp;&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>Thu, 11 Dec 2025 09:24:34 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/Mathcad/Finding-the-average-value/m-p/1047185#M219908</guid>
      <dc:creator>YA_10963798</dc:creator>
      <dc:date>2025-12-11T09:24:34Z</dc:date>
    </item>
    <item>
      <title>Re: Finding the average value</title>
      <link>https://www.ptcusercommunity.com/t5/Mathcad/Finding-the-average-value/m-p/1047223#M219910</link>
      <description>&lt;P&gt;I don't remember about this program but if the failing program you show in your first pic ever worked OK, then "z" and "q.cza" must have been nested vectors.&lt;/P&gt;
&lt;P&gt;Not they seem to be normal vectors consisting of scalars and so the program fails. You cannot expect a program to still work OK if you change the type of data structure of the input variables.&lt;/P&gt;
&lt;P&gt;When, in your second picture, you use "z" and "qcza" instead of the now useless "Z" and "Q", you are actually doing the very same calculation 12 times (assuming that z consists of 12 elements) and so you get a nested vector consisting of 12 equal vectors.&lt;/P&gt;
&lt;P&gt;You may remove the outer for-loop (the one with "i") and see if the result is now what you expect.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;BTW, even though there are forum problems with attachments at the time, you still can attach your file if you put it in an archive (ZIP, RAR, ...) and attach this archive.&lt;/P&gt;</description>
      <pubDate>Thu, 11 Dec 2025 15:22:28 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/Mathcad/Finding-the-average-value/m-p/1047223#M219910</guid>
      <dc:creator>Werner_E</dc:creator>
      <dc:date>2025-12-11T15:22:28Z</dc:date>
    </item>
    <item>
      <title>Re: Finding the average value</title>
      <link>https://www.ptcusercommunity.com/t5/Mathcad/Finding-the-average-value/m-p/1047233#M219911</link>
      <description>&lt;P&gt;Ok I will try to do that , or I will just zip the file and upload it&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 11 Dec 2025 14:08:17 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/Mathcad/Finding-the-average-value/m-p/1047233#M219911</guid>
      <dc:creator>YA_10963798</dc:creator>
      <dc:date>2025-12-11T14:08:17Z</dc:date>
    </item>
  </channel>
</rss>

