<?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 How to drop out of loop in Mathcad</title>
    <link>https://www.ptcusercommunity.com/t5/Mathcad/How-to-drop-out-of-loop/m-p/650470#M188862</link>
    <description>&lt;P&gt;&lt;FONT face="times new roman,times"&gt;Here is my FORTRAN statements:&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; DO 1010 I=1,L&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;DO 1010 J=1,NC119&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;X119(I,J) = 0.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;X132(J,I) = 0.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;IF(YEN(J) -YV(I)) 1010,1000,1000&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp;1000 &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;X119(I,J) = 1.0&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp;1010 CONTINUE&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; JAK = 1&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; DO 1040 I=1,NC119&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;DO 1020 J=JAK,L&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;IF(YE(J)) 1020,1020,1030&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp;1020 &amp;nbsp;&amp;nbsp;CONTINUE&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; GO TO 1040&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp;1030 &amp;nbsp;&amp;nbsp;X132(I,J) = 1.0&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;JAK = J+1&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp;1040 CONTINUE&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="times new roman,times"&gt;I include my attempt, results and what I want.&lt;/FONT&gt;&lt;/P&gt;</description>
    <pubDate>Sat, 22 Feb 2020 17:44:26 GMT</pubDate>
    <dc:creator>ptc-2283641</dc:creator>
    <dc:date>2020-02-22T17:44:26Z</dc:date>
    <item>
      <title>How to drop out of loop</title>
      <link>https://www.ptcusercommunity.com/t5/Mathcad/How-to-drop-out-of-loop/m-p/650470#M188862</link>
      <description>&lt;P&gt;&lt;FONT face="times new roman,times"&gt;Here is my FORTRAN statements:&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; DO 1010 I=1,L&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;DO 1010 J=1,NC119&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;X119(I,J) = 0.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;X132(J,I) = 0.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;IF(YEN(J) -YV(I)) 1010,1000,1000&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp;1000 &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;X119(I,J) = 1.0&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp;1010 CONTINUE&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; JAK = 1&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; DO 1040 I=1,NC119&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;DO 1020 J=JAK,L&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;IF(YE(J)) 1020,1020,1030&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp;1020 &amp;nbsp;&amp;nbsp;CONTINUE&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; GO TO 1040&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp;1030 &amp;nbsp;&amp;nbsp;X132(I,J) = 1.0&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;JAK = J+1&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp;1040 CONTINUE&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="times new roman,times"&gt;I include my attempt, results and what I want.&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 22 Feb 2020 17:44:26 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/Mathcad/How-to-drop-out-of-loop/m-p/650470#M188862</guid>
      <dc:creator>ptc-2283641</dc:creator>
      <dc:date>2020-02-22T17:44:26Z</dc:date>
    </item>
    <item>
      <title>Re: How to drop out of loop</title>
      <link>https://www.ptcusercommunity.com/t5/Mathcad/How-to-drop-out-of-loop/m-p/650473#M188864</link>
      <description>&lt;P&gt;Your Prime&amp;nbsp; and Fortran programs are different.&lt;/P&gt;
&lt;P&gt;Assuming the Fortran code functions according to your desired behaviour (whatever that may be), these are the differences I see so far:&lt;/P&gt;
&lt;P&gt;JAK &amp;lt;- JAK+1 should be JAK&amp;lt;J+1&lt;/P&gt;
&lt;P&gt;You to place this JAK assigment immediately below the X132 assignment, not below/outside of thye entire IF statement.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Success!&lt;BR /&gt;Luc&lt;/P&gt;</description>
      <pubDate>Sat, 22 Feb 2020 18:19:00 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/Mathcad/How-to-drop-out-of-loop/m-p/650473#M188864</guid>
      <dc:creator>LucMeekes</dc:creator>
      <dc:date>2020-02-22T18:19:00Z</dc:date>
    </item>
    <item>
      <title>Re: How to drop out of loop</title>
      <link>https://www.ptcusercommunity.com/t5/Mathcad/How-to-drop-out-of-loop/m-p/650475#M188866</link>
      <description>&lt;DIV class="ydp6517fd62yahoo-style-wrap" dir="ltr" data-setdir="false"&gt;X132i,j&amp;nbsp;&lt;SPAN&gt;←&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;1&lt;/DIV&gt;
&lt;DIV class="ydp6517fd62yahoo-style-wrap" dir="ltr" data-setdir="false"&gt;JAK&amp;nbsp;&lt;SPAN&gt;←&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;j + 1&lt;/DIV&gt;
&lt;DIV class="ydp6517fd62yahoo-style-wrap" dir="ltr" data-setdir="false"&gt;gives me a 1x12 matrix, not a 2x16.&lt;/DIV&gt;
&lt;DIV class="ydp6517fd62yahoo-style-wrap" dir="ltr" data-setdir="false"&gt;Ken&lt;/DIV&gt;</description>
      <pubDate>Sat, 22 Feb 2020 19:04:28 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/Mathcad/How-to-drop-out-of-loop/m-p/650475#M188866</guid>
      <dc:creator>ptc-2283641</dc:creator>
      <dc:date>2020-02-22T19:04:28Z</dc:date>
    </item>
    <item>
      <title>Re: How to drop out of loop</title>
      <link>https://www.ptcusercommunity.com/t5/Mathcad/How-to-drop-out-of-loop/m-p/650481#M188869</link>
      <description>&lt;P&gt;The "&lt;FONT face="courier new,courier"&gt;IF(YE(J))&lt;/FONT&gt;" in your Fortran code looks like an IF statement at first sight, but it isn't because it is NOT followd by "THEN".&lt;/P&gt;
&lt;P&gt;What does it do? Especially the three numbers following the IF() are puzzling. Are they line numbers? And how are they processed?&lt;/P&gt;
&lt;P&gt;In the first Mathcad program (X119) you translated the IF(argument) with "if argument &amp;gt;=0" in X132 you translated a similar construct IF(argument) with 'if argument &amp;lt;=0". Which one of the two is right, 'less than or equal', or 'larger than or equal' ?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It might help a lot if you could explain what functionality you wanted to program. What is the effect that your function should accomplish, in plain text.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Success!&lt;BR /&gt;Luc&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 22 Feb 2020 21:49:09 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/Mathcad/How-to-drop-out-of-loop/m-p/650481#M188869</guid>
      <dc:creator>LucMeekes</dc:creator>
      <dc:date>2020-02-22T21:49:09Z</dc:date>
    </item>
    <item>
      <title>Re: How to drop out of loop</title>
      <link>https://www.ptcusercommunity.com/t5/Mathcad/How-to-drop-out-of-loop/m-p/650482#M188870</link>
      <description>&lt;P&gt;&lt;SPAN&gt;That "&lt;/SPAN&gt;&lt;FONT face="courier new,courier"&gt;IF(YE(J))&lt;/FONT&gt;&lt;SPAN&gt;" in the Fortran code IS an IF statement, unless you are using some version I am not aware of. "IF...THEN..." sounds like&amp;nbsp;&amp;nbsp;BASIC code too me. To me&amp;nbsp;"&lt;FONT face="courier new,courier"&gt;IF(YE(J)) 1020,1020,1030&lt;/FONT&gt;" in FORTRAN means&amp;nbsp;"&lt;FONT face="courier new,courier"&gt;IF(YE(J)) ≤ 0 go to statement 1020,or &amp;gt; 0 go to statement 1030&lt;/FONT&gt;". I work in FORTRAN versions like WATFOR or 95, which might be before your time and any newer International Standards.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;If you were able to examine my MathCad Prime 3.1 attachment, I listed the known variables and attempts for the 2x16 row matrix called X132. I just cannot get a single "1" in the desired elements, i.e. 1,1 and 2,12. The 16x2 column matrix X119 is correct.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 22 Feb 2020 22:09:22 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/Mathcad/How-to-drop-out-of-loop/m-p/650482#M188870</guid>
      <dc:creator>ptc-2283641</dc:creator>
      <dc:date>2020-02-22T22:09:22Z</dc:date>
    </item>
    <item>
      <title>Re: How to drop out of loop</title>
      <link>https://www.ptcusercommunity.com/t5/Mathcad/How-to-drop-out-of-loop/m-p/650485#M188871</link>
      <description>&lt;P&gt;Are you looking for this?&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="LucMeekes_0-1582411861840.png" style="width: 400px;"&gt;&lt;img src="https://www.ptcusercommunity.com/t5/image/serverpage/image-id/23845i29B2F1AB2375FE7D/image-size/medium?v=v2&amp;amp;px=400" role="button" title="LucMeekes_0-1582411861840.png" alt="LucMeekes_0-1582411861840.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Success!&lt;BR /&gt;Luc&lt;/P&gt;</description>
      <pubDate>Sat, 22 Feb 2020 22:51:31 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/Mathcad/How-to-drop-out-of-loop/m-p/650485#M188871</guid>
      <dc:creator>LucMeekes</dc:creator>
      <dc:date>2020-02-22T22:51:31Z</dc:date>
    </item>
    <item>
      <title>Re: How to drop out of loop</title>
      <link>https://www.ptcusercommunity.com/t5/Mathcad/How-to-drop-out-of-loop/m-p/650486#M188872</link>
      <description>&lt;P&gt;Got it! See attachment.&lt;/P&gt;</description>
      <pubDate>Sat, 22 Feb 2020 23:00:12 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/Mathcad/How-to-drop-out-of-loop/m-p/650486#M188872</guid>
      <dc:creator>ptc-2283641</dc:creator>
      <dc:date>2020-02-22T23:00:12Z</dc:date>
    </item>
    <item>
      <title>Re: How to drop out of loop</title>
      <link>https://www.ptcusercommunity.com/t5/Mathcad/How-to-drop-out-of-loop/m-p/650487#M188873</link>
      <description>&lt;P&gt;Most interesting approach, I was not aware that any version of MathCad (including Prime) had these functions.&lt;/P&gt;
&lt;P&gt;Thanks for you assistance. Hope you were able to view my previous attachment.&lt;/P&gt;
&lt;P&gt;Ken&lt;/P&gt;</description>
      <pubDate>Sat, 22 Feb 2020 23:05:35 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/Mathcad/How-to-drop-out-of-loop/m-p/650487#M188873</guid>
      <dc:creator>ptc-2283641</dc:creator>
      <dc:date>2020-02-22T23:05:35Z</dc:date>
    </item>
    <item>
      <title>Re: How to drop out of loop</title>
      <link>https://www.ptcusercommunity.com/t5/Mathcad/How-to-drop-out-of-loop/m-p/650490#M188874</link>
      <description>&lt;P&gt;LucMeeks,&lt;/P&gt;
&lt;P&gt;Here is my final attempt. I have tried reducing statements, but I cannot. Your solution seems to want an exact match(?) between YEN and YV.&lt;/P&gt;
&lt;P&gt;Ken&lt;/P&gt;</description>
      <pubDate>Sun, 23 Feb 2020 12:41:08 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/Mathcad/How-to-drop-out-of-loop/m-p/650490#M188874</guid>
      <dc:creator>ptc-2283641</dc:creator>
      <dc:date>2020-02-23T12:41:08Z</dc:date>
    </item>
    <item>
      <title>Re: How to drop out of loop</title>
      <link>https://www.ptcusercommunity.com/t5/Mathcad/How-to-drop-out-of-loop/m-p/650509#M188875</link>
      <description>&lt;P&gt;Here is my attempt to translate your FORTRAN program to Prime one to one. Its similar to yours and the missing point, as you had found out on your own, was the break command to jump out from the inner loop (which nowadays is considered bad programming style ;-).&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Werner_E_0-1582503401855.png" style="width: 735px;"&gt;&lt;img src="https://www.ptcusercommunity.com/t5/image/serverpage/image-id/23858i1A5508C37C248E98/image-dimensions/735x534?v=v2" width="735" height="534" role="button" title="Werner_E_0-1582503401855.png" alt="Werner_E_0-1582503401855.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Of course this can be made a bit shorter because in Mathcad, as you found out yourself, its not necessary to set every single element in a matrix to zero. The values are zero by default, no need to initialize.&lt;/P&gt;
&lt;P&gt;Not sure if you already realized, that variables used in a Prime program at the left side of an assignment are always local variables only and do not correspond to variables at worksheet level with the same name. So your second program does NOT use the X132 you created in your first program. The only way to change worksheet variables is to assign them the result of a program. So you may notice that the program variables in my program are called X119 and X132 but the worksheet variables have different names (same, but with the number as literal index).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Luc's suggestion only works in MC11, not in MC15 and also not in Prime.&lt;/P&gt;
&lt;P&gt;Here is a similar approach which works in Prime, too. It uses Y.E for comparison as the original program:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Werner_E_0-1582504923145.png" style="width: 774px;"&gt;&lt;img src="https://www.ptcusercommunity.com/t5/image/serverpage/image-id/23860i35AEAC4E9FD091B0/image-dimensions/774x209?v=v2" width="774" height="209" role="button" title="Werner_E_0-1582504923145.png" alt="Werner_E_0-1582504923145.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;As I could only provide a Prime 5 or Prime 6 worksheet, I don't attach it as your Prime 3.1 would not be able to read it.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 24 Feb 2020 00:42:20 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/Mathcad/How-to-drop-out-of-loop/m-p/650509#M188875</guid>
      <dc:creator>Werner_E</dc:creator>
      <dc:date>2020-02-24T00:42:20Z</dc:date>
    </item>
    <item>
      <title>Re: How to drop out of loop</title>
      <link>https://www.ptcusercommunity.com/t5/Mathcad/How-to-drop-out-of-loop/m-p/650701#M188879</link>
      <description>&lt;P&gt;You've multiplied the result of the match() function with ORIGIN, whereas you should only take its first element.&lt;/P&gt;
&lt;P&gt;Please try again with the attached file that should open in Prime 3.1&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, 24 Feb 2020 20:47:52 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/Mathcad/How-to-drop-out-of-loop/m-p/650701#M188879</guid>
      <dc:creator>LucMeekes</dc:creator>
      <dc:date>2020-02-24T20:47:52Z</dc:date>
    </item>
    <item>
      <title>Re: How to drop out of loop</title>
      <link>https://www.ptcusercommunity.com/t5/Mathcad/How-to-drop-out-of-loop/m-p/650705#M188880</link>
      <description>&lt;P&gt;This is what we get after recalculating the sheet:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Werner_E_0-1582580595992.png" style="width: 400px;"&gt;&lt;img src="https://www.ptcusercommunity.com/t5/image/serverpage/image-id/23889iF338D67741DD4DE9/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Werner_E_0-1582580595992.png" alt="Werner_E_0-1582580595992.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I was surprised to see, that in Prime we can use "max" as function in matrix again. As you know it was allowed in MC11, but it failed in later versions (at least in MC14 and MC15).&lt;/P&gt;
&lt;P&gt;Nevertheless I feel that in this case simply assigning the "last" element of the matrix a zero would be more efficient&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Werner_E_0-1582580912008.png" style="width: 400px;"&gt;&lt;img src="https://www.ptcusercommunity.com/t5/image/serverpage/image-id/23890i5BCB9CD5F94AD530/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Werner_E_0-1582580912008.png" alt="Werner_E_0-1582580912008.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>Mon, 24 Feb 2020 21:48:30 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/Mathcad/How-to-drop-out-of-loop/m-p/650705#M188880</guid>
      <dc:creator>Werner_E</dc:creator>
      <dc:date>2020-02-24T21:48:30Z</dc:date>
    </item>
    <item>
      <title>Re: How to drop out of loop</title>
      <link>https://www.ptcusercommunity.com/t5/Mathcad/How-to-drop-out-of-loop/m-p/650708#M188881</link>
      <description>&lt;P&gt;Provided that ORIGIN=1 !!&lt;/P&gt;
&lt;P&gt;I've used max a lot of times as third argument in the matrix() function, see my 'it's a joke' post.&lt;/P&gt;
&lt;P&gt;I agree that:&lt;/P&gt;
&lt;P&gt;R[ORIGIN+rows(YEN)-1,ORIGIN+rows(Y)-1 &amp;lt;- 0&lt;/P&gt;
&lt;P&gt;would be better here, but it's longer...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I may have made a mistake in implementing Match() in Mathcad 11.&lt;/P&gt;
&lt;P&gt;Can you changing "geq" to "leq"?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Luc&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 24 Feb 2020 22:00:29 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/Mathcad/How-to-drop-out-of-loop/m-p/650708#M188881</guid>
      <dc:creator>LucMeekes</dc:creator>
      <dc:date>2020-02-24T22:00:29Z</dc:date>
    </item>
    <item>
      <title>Re: How to drop out of loop</title>
      <link>https://www.ptcusercommunity.com/t5/Mathcad/How-to-drop-out-of-loop/m-p/650717#M188882</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;
&lt;P&gt;Can you changing "geq" to "leq"?&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Sure, here you are - looks good&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Werner_E_0-1582590865265.png" style="width: 704px;"&gt;&lt;img src="https://www.ptcusercommunity.com/t5/image/serverpage/image-id/23893i31628750CFDA28B8/image-dimensions/704x233?v=v2" width="704" height="233" role="button" title="Werner_E_0-1582590865265.png" alt="Werner_E_0-1582590865265.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 25 Feb 2020 00:34:52 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/Mathcad/How-to-drop-out-of-loop/m-p/650717#M188882</guid>
      <dc:creator>Werner_E</dc:creator>
      <dc:date>2020-02-25T00:34:52Z</dc:date>
    </item>
    <item>
      <title>Re: How to drop out of loop</title>
      <link>https://www.ptcusercommunity.com/t5/Mathcad/How-to-drop-out-of-loop/m-p/650718#M188883</link>
      <description>&lt;P&gt;Your file&amp;nbsp;Untitled_20200224_Prime3_1.mcdx&amp;nbsp;does not open.&lt;/P&gt;
&lt;P&gt;Changing "geq" to "leq", and using R(subscript rows(YEN),rows(Y))&amp;nbsp;← 0 gets me this 2x16 matrix&lt;/P&gt;
&lt;P&gt;0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15&lt;/P&gt;
&lt;P&gt;1 1 2 3&amp;nbsp;4 5 6 7 8 9 10 11 12 13 14&amp;nbsp; &amp;nbsp;0&lt;/P&gt;
&lt;P&gt;Even leaving off ORIGIN give same results. See my Prime 3.1 attachment where&amp;nbsp;I now initialize the matrix X132 to "0" by placing it in the X132 program to keep from returning two matrices in the X119 program. Changing the "if Yv(j) &amp;gt; 0" statement to "if YEN(i) - Yv(j) &amp;gt; 0", and adding the "also if X132(i,j) &amp;gt; 0" statement to break out of the "DO 1020" inner-loop gives me my matrix requiring a "1" in its aero-panel location, i.e.&lt;/P&gt;
&lt;P&gt;1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0&lt;/P&gt;
&lt;P&gt;0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 25 Feb 2020 00:43:33 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/Mathcad/How-to-drop-out-of-loop/m-p/650718#M188883</guid>
      <dc:creator>ptc-2283641</dc:creator>
      <dc:date>2020-02-25T00:43:33Z</dc:date>
    </item>
    <item>
      <title>Re: How to drop out of loop</title>
      <link>https://www.ptcusercommunity.com/t5/Mathcad/How-to-drop-out-of-loop/m-p/650760#M188884</link>
      <description>&lt;P&gt;Here's the file, corrected and saved from Prime 3.1, so it should open in Prime 3.1.&lt;/P&gt;
&lt;P&gt;I'll explain the program:&lt;/P&gt;
&lt;P&gt;The first line creates R as a matrix of 0's, the size of which is determined by the numbers of rows of YEN and Y, using the matrix function, and sets it to all 0's by multiplying it with 0.&lt;/P&gt;
&lt;P&gt;The second line starts the for loop, to go through all (at present 2...) elements of vector YEN.&lt;/P&gt;
&lt;P&gt;Within that loop the first statement&amp;nbsp; uses the match function that finds all indices in array Y whose value is less than, or equal to th chosen YEN element's value. Given the values above, match finds the list of indices from ORIGIN to last(Y) when we're working with the first value of YEN. From that array, only the very first (the one with index ORIGIN) is assigned to e. So e holds the index where, for the first time, an element value of Y is below the chosen value of YEN.&lt;/P&gt;
&lt;P&gt;In the second row the element of matrix R whose index is determined by r and e is set to 1.&lt;/P&gt;
&lt;P&gt;The second time around in this loop, match should give a list of indices starting at the 12th element and on to the last. Again only the first of that list, the index pointing to the 12th element is assigned to e. An again at the chosen position in R a 1 is set.&lt;/P&gt;
&lt;P&gt;When all elements of YEN are processed, the matrix R is returned as the function result.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Success!&lt;BR /&gt;Luc&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 25 Feb 2020 07:13:22 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/Mathcad/How-to-drop-out-of-loop/m-p/650760#M188884</guid>
      <dc:creator>LucMeekes</dc:creator>
      <dc:date>2020-02-25T07:13:22Z</dc:date>
    </item>
    <item>
      <title>Re: How to drop out of loop</title>
      <link>https://www.ptcusercommunity.com/t5/Mathcad/How-to-drop-out-of-loop/m-p/650908#M188889</link>
      <description>&lt;P&gt;Thanks for your help.&lt;/P&gt;</description>
      <pubDate>Tue, 25 Feb 2020 15:59:19 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/Mathcad/How-to-drop-out-of-loop/m-p/650908#M188889</guid>
      <dc:creator>ptc-2283641</dc:creator>
      <dc:date>2020-02-25T15:59:19Z</dc:date>
    </item>
  </channel>
</rss>

