<?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: Return only the KP value when F is greater than 0 in Mathcad</title>
    <link>https://community.ptc.com/t5/Mathcad/Return-only-the-KP-value-when-F-is-greater-than-0/m-p/881980#M207125</link>
    <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://community.ptc.com/t5/user/viewprofilepage/user-id/313000"&gt;@davidlimtw&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;I would like to add also a function to filter to return only the KP where F &amp;gt; 0 and another matrix showing the only F &amp;gt; 0 values.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Examples always would be welcome to clarify what exactly is needed.&lt;/P&gt;
&lt;P&gt;A I understood it now you want the values in both vectors removed when F is zero or negative so only the positive values in F remain and also the corresponding values in KP?&lt;/P&gt;
&lt;P&gt;Could be done in many ways, one is shown here&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Werner_E_0-1687179913577.png" style="width: 400px;"&gt;&lt;img src="https://community.ptc.com/t5/image/serverpage/image-id/83871i1842D263B18CE61B/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Werner_E_0-1687179913577.png" alt="Werner_E_0-1687179913577.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 19 Jun 2023 13:07:06 GMT</pubDate>
    <dc:creator>Werner_E</dc:creator>
    <dc:date>2023-06-19T13:07:06Z</dc:date>
    <item>
      <title>Return only the KP value when F is greater than 0</title>
      <link>https://community.ptc.com/t5/Mathcad/Return-only-the-KP-value-when-F-is-greater-than-0/m-p/881916#M207119</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Dear All,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I am trying to write a program to return the only KP values when F is greater than 0.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="davidlimtw_1-1687172716513.png" style="width: 400px;"&gt;&lt;img src="https://community.ptc.com/t5/image/serverpage/image-id/83847iAD118392E191AA09/image-size/medium?v=v2&amp;amp;px=400" role="button" title="davidlimtw_1-1687172716513.png" alt="davidlimtw_1-1687172716513.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="headerbuttontrackingcode"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 19 Jun 2023 11:05:31 GMT</pubDate>
      <guid>https://community.ptc.com/t5/Mathcad/Return-only-the-KP-value-when-F-is-greater-than-0/m-p/881916#M207119</guid>
      <dc:creator>davidlimtw</dc:creator>
      <dc:date>2023-06-19T11:05:31Z</dc:date>
    </item>
    <item>
      <title>Re: Return only the KP value when F is greater than 0</title>
      <link>https://community.ptc.com/t5/Mathcad/Return-only-the-KP-value-when-F-is-greater-than-0/m-p/881942#M207123</link>
      <description>&lt;P&gt;I would like to add also a function to filter to return only the KP where F &amp;gt; 0 and another matrix showing the only F &amp;gt; 0 values.&lt;/P&gt;</description>
      <pubDate>Mon, 19 Jun 2023 12:25:19 GMT</pubDate>
      <guid>https://community.ptc.com/t5/Mathcad/Return-only-the-KP-value-when-F-is-greater-than-0/m-p/881942#M207123</guid>
      <dc:creator>davidlimtw</dc:creator>
      <dc:date>2023-06-19T12:25:19Z</dc:date>
    </item>
    <item>
      <title>Re: Return only the KP value when F is greater than 0</title>
      <link>https://community.ptc.com/t5/Mathcad/Return-only-the-KP-value-when-F-is-greater-than-0/m-p/881963#M207124</link>
      <description>&lt;P&gt;Again its not really clear what exactly you expect as result and giving one or two examples would have helped.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In the following approach I assumed that you want a vector with the values of KP but replace the original value if the value in F at the corresponding position is negative.&lt;/P&gt;
&lt;P&gt;Here is a short approach using vectorization&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Werner_E_0-1687177203159.png" style="width: 324px;"&gt;&lt;img src="https://community.ptc.com/t5/image/serverpage/image-id/83856iE556DE256F8DED52/image-dimensions/324x55?v=v2" width="324" height="55" role="button" title="Werner_E_0-1687177203159.png" alt="Werner_E_0-1687177203159.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;We can use a table built with augment to check the results&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Werner_E_1-1687177248295.png" style="width: 400px;"&gt;&lt;img src="https://community.ptc.com/t5/image/serverpage/image-id/83857i8F0049AE55590521/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Werner_E_1-1687177248295.png" alt="Werner_E_1-1687177248295.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And here is a more "natural" approach with a function using a for loop&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Werner_E_4-1687178081241.png" style="width: 319px;"&gt;&lt;img src="https://community.ptc.com/t5/image/serverpage/image-id/83861iC122950430948F60/image-dimensions/319x198?v=v2" width="319" height="198" role="button" title="Werner_E_4-1687178081241.png" alt="Werner_E_4-1687178081241.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;You can replace the 0m by NaN or whatever may be appropriate.&lt;/P&gt;
&lt;P&gt;We can check if both ways return the same result&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Werner_E_5-1687178123308.png" style="width: 216px;"&gt;&lt;img src="https://community.ptc.com/t5/image/serverpage/image-id/83862iAD4C41FFF4E46D23/image-dimensions/216x163?v=v2" width="216" height="163" role="button" title="Werner_E_5-1687178123308.png" alt="Werner_E_5-1687178123308.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Using the if-&lt;EM&gt;&lt;STRONG&gt;function&lt;/STRONG&gt;&lt;/EM&gt; we can write it less space consuming&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Werner_E_6-1687178181637.png" style="width: 400px;"&gt;&lt;img src="https://community.ptc.com/t5/image/serverpage/image-id/83863i70A1EB7CBB771A47/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Werner_E_6-1687178181637.png" alt="Werner_E_6-1687178181637.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;One may think that we could simply vectorize that if-function&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Werner_E_8-1687178266989.png" style="width: 312px;"&gt;&lt;img src="https://community.ptc.com/t5/image/serverpage/image-id/83865i2FF77AE3F377128A/image-dimensions/312x39?v=v2" width="312" height="39" role="button" title="Werner_E_8-1687178266989.png" alt="Werner_E_8-1687178266989.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;but this does not work&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Werner_E_9-1687178290269.png" style="width: 248px;"&gt;&lt;img src="https://community.ptc.com/t5/image/serverpage/image-id/83866i0635D3FA4D3B8B08/image-dimensions/248x36?v=v2" width="248" height="36" role="button" title="Werner_E_9-1687178290269.png" alt="Werner_E_9-1687178290269.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;because Prime does not allow to vectorize comparison operators like the &amp;lt; directly, but we are allowed to vectorize a function which uses the comparison:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Werner_E_10-1687178360095.png" style="width: 361px;"&gt;&lt;img src="https://community.ptc.com/t5/image/serverpage/image-id/83867iC33A9372C197CE1A/image-dimensions/361x39?v=v2" width="361" height="39" role="button" title="Werner_E_10-1687178360095.png" alt="Werner_E_10-1687178360095.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="Werner_E_11-1687178371793.png" style="width: 251px;"&gt;&lt;img src="https://community.ptc.com/t5/image/serverpage/image-id/83868iE19FE034503803CA/image-dimensions/251x42?v=v2" width="251" height="42" role="button" title="Werner_E_11-1687178371793.png" alt="Werner_E_11-1687178371793.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Prime 9 worksheet attached&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 19 Jun 2023 12:40:50 GMT</pubDate>
      <guid>https://community.ptc.com/t5/Mathcad/Return-only-the-KP-value-when-F-is-greater-than-0/m-p/881963#M207124</guid>
      <dc:creator>Werner_E</dc:creator>
      <dc:date>2023-06-19T12:40:50Z</dc:date>
    </item>
    <item>
      <title>Re: Return only the KP value when F is greater than 0</title>
      <link>https://community.ptc.com/t5/Mathcad/Return-only-the-KP-value-when-F-is-greater-than-0/m-p/881980#M207125</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://community.ptc.com/t5/user/viewprofilepage/user-id/313000"&gt;@davidlimtw&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;I would like to add also a function to filter to return only the KP where F &amp;gt; 0 and another matrix showing the only F &amp;gt; 0 values.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Examples always would be welcome to clarify what exactly is needed.&lt;/P&gt;
&lt;P&gt;A I understood it now you want the values in both vectors removed when F is zero or negative so only the positive values in F remain and also the corresponding values in KP?&lt;/P&gt;
&lt;P&gt;Could be done in many ways, one is shown here&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Werner_E_0-1687179913577.png" style="width: 400px;"&gt;&lt;img src="https://community.ptc.com/t5/image/serverpage/image-id/83871i1842D263B18CE61B/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Werner_E_0-1687179913577.png" alt="Werner_E_0-1687179913577.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 19 Jun 2023 13:07:06 GMT</pubDate>
      <guid>https://community.ptc.com/t5/Mathcad/Return-only-the-KP-value-when-F-is-greater-than-0/m-p/881980#M207125</guid>
      <dc:creator>Werner_E</dc:creator>
      <dc:date>2023-06-19T13:07:06Z</dc:date>
    </item>
  </channel>
</rss>

