topic Re: Referencing Another Row in a Table in MathCad Prime 3.1 in PTC Mathcad
https://community.ptc.com/t5/PTC-Mathcad/Referencing-Another-Row-in-a-Table-in-MathCad-Prime-3-1/m-p/116619#M45686
<HTML><HEAD></HEAD><BODY><P>Hi Stuart,</P><P></P><P>From reading the help text, I (implicitly) assumed that the table is nothing more than an assembled set of variable definitions, mostly geared towards actually producing a(n input) table from column vectors. Hence my first (clumsy) example.</P><P>Especially with the remark that all possibilities of operations on/with table columns are the same as on column vectors made me stop worrying and just treat a table as a row (left to righ) of vector definitions, with the (again implicit) assumption that table elements can reference items to their left.</P><P>It wasn't until I saw your first experiments that I realized that table elements could be scalars and vectors mixed, that's nice.</P><P>The help for Prime states that tables can only be used for Input. If you want Output in a table-like form, you'll have to assemble a matrix from the vectors, but then you must be sure to fill the entire rectangle of the matrix. Fortunately matrix elements can have mixed units in Prime...</P><P></P><P>Luc</P></BODY></HTML>Thu, 30 Jul 2015 13:11:34 GMTLucMeekes2015-07-30T13:11:34ZReferencing Another Row in a Table in MathCad Prime 3.1
https://community.ptc.com/t5/PTC-Mathcad/Referencing-Another-Row-in-a-Table-in-MathCad-Prime-3-1/m-p/116613#M45680
I would like to create a table where one of the columns was a calculation that involved items in multiple rows of another column. For example on column had gear ratios and another had the split between adjoining gears. It is possible to reference another column and an entry in theThu, 03 May 2018 15:15:29 GMThttps://community.ptc.com/t5/PTC-Mathcad/Referencing-Another-Row-in-a-Table-in-MathCad-Prime-3-1/m-p/116613#M45680DavidNJ2018-05-03T15:15:29ZRe: Referencing Another Row in a Table in MathCad Prime 3.1
https://community.ptc.com/t5/PTC-Mathcad/Referencing-Another-Row-in-a-Table-in-MathCad-Prime-3-1/m-p/116614#M45681
<HTML><HEAD></HEAD><BODY><P>You mean something like this?</P><P><IMG alt="" class="jive-image image-1" src="https://community.ptc.com/legacyfs/online/90172_pastedImage_0.png" style="max-width: 1200px; max-height: 900px;" /></P></BODY></HTML>Wed, 29 Jul 2015 21:53:41 GMThttps://community.ptc.com/t5/PTC-Mathcad/Referencing-Another-Row-in-a-Table-in-MathCad-Prime-3-1/m-p/116614#M45681LucMeekes2015-07-29T21:53:41ZRe: Referencing Another Row in a Table in MathCad Prime 3.1
https://community.ptc.com/t5/PTC-Mathcad/Referencing-Another-Row-in-a-Table-in-MathCad-Prime-3-1/m-p/116615#M45682
<HTML><HEAD></HEAD><BODY><BLOCKQUOTE><TABLE border="1"><TBODY><TR><TD>
<P>David Ziegelheim wrote:</P>
<P></P>
<P>I would like to create a table where one of the columns was a calculation that involved items in multiple rows of another column. For example on column had gear ratios and another had the split between adjoining gears.</P>
<P style="min-height: 8pt; padding: 0px;"></P>
<P>It is possible to reference another column and an entry in the top row populates (but doesn't display) the values in the other cells of that column. Is there a way to reference a cell in a different row from within a table?</P>
<P style="min-height: 8pt; padding: 0px;"></P>
<P>The documentation on tables in Mathcad Prime is next to non-existent.</P>
<P style="min-height: 8pt; padding: 0px;"></P>
<P>Is it possible to have a table display all values and not just the calculation equation in the top row?</P>
</TD></TR></TBODY></TABLE></BLOCKQUOTE><P></P><P>Following on from Luc's reply, it appears as if a Prime Table is effectively a shorthand method of defining a set of variables, where each variable can be a scalar, array or function. Prime evaluates a table in the the standard left-right fashion, but does it column-wise. This means that in any given column you can reference any variables (columns) defined to the left of it in a Table, but not any defined to the right. You can independently reference any element of a variable as per a normal array.</P><P></P><P>I don't know whether this is documented anywhere .. I just had a play with it.</P><P></P><P>Stuart</P><P></P><P><IMG alt="" class="jive-image image-1" src="https://community.ptc.com/legacyfs/online/90179_pastedImage_0.png" style="max-width: 1200px; max-height: 900px;" /></P></BODY></HTML>Thu, 30 Jul 2015 07:07:27 GMThttps://community.ptc.com/t5/PTC-Mathcad/Referencing-Another-Row-in-a-Table-in-MathCad-Prime-3-1/m-p/116615#M45682StuartBruff2015-07-30T07:07:27ZRe: Referencing Another Row in a Table in MathCad Prime 3.1
https://community.ptc.com/t5/PTC-Mathcad/Referencing-Another-Row-in-a-Table-in-MathCad-Prime-3-1/m-p/116616#M45683
<HTML><HEAD></HEAD><BODY><P>With regards to documentation, just look it up in the help:</P><P><IMG alt="" class="jive-image image-1" src="https://community.ptc.com/legacyfs/online/90180_pastedImage_0.png" style="max-width: 1200px; max-height: 900px;" /></P><P><IMG alt="" class="jive-image image-2" src="https://community.ptc.com/legacyfs/online/90181_pastedImage_1.png" style="max-width: 1200px; max-height: 900px;" /></P><P>And so, I think this is what you want:</P><P><IMG alt="" class="jive-image image-3" src="https://community.ptc.com/legacyfs/online/90185_pastedImage_4.png" style="max-width: 1200px; max-height: 900px;" /></P><P>Success!<BR />Luc</P></BODY></HTML>Thu, 30 Jul 2015 09:35:11 GMThttps://community.ptc.com/t5/PTC-Mathcad/Referencing-Another-Row-in-a-Table-in-MathCad-Prime-3-1/m-p/116616#M45683LucMeekes2015-07-30T09:35:11ZRe: Referencing Another Row in a Table in MathCad Prime 3.1
https://community.ptc.com/t5/PTC-Mathcad/Referencing-Another-Row-in-a-Table-in-MathCad-Prime-3-1/m-p/116617#M45684
<HTML><HEAD></HEAD><BODY><BLOCKQUOTE><TABLE border="1"><TBODY><TR><TD>
<P>LucMeekes wrote:</P>
<P></P>
<P>With regards to documentation, just look it up in the help:</P>
<P>And so, I think this is what you want:</P>
<P><IMG __jive_id="90192" alt="" class="jive-image image-3" height="246" src="https://community.ptc.com/legacyfs/online/90192_pastedImage_4.png" style="max-width: 363px;" width="363" /></P>
<P>Success!<BR />Luc</P>
</TD></TR></TBODY></TABLE></BLOCKQUOTE><P></P><P>Hi Luc,</P><P></P><P>Unfortunately, I don't think that the documentation makes it clear what's going on in a table definition. It (to me, at least) gives the impression that the columns must be scalars and does not make it clear that there is a left-right column order for definitions or that operations can be carried out on "already defined" variables (Table columns). There was a bit more in my original worksheet pointing out that a Table treats a single element in a column as being a normal definition, rather than as a single-element vector. I've updated the worksheet to show how to define a single-element array using Table.</P><P></P><P>Stuart</P><P></P><P><IMG alt="" class="jive-image image-4" src="https://community.ptc.com/legacyfs/online/90194_pastedImage_1.png" style="max-width: 1200px; max-height: 900px;" /></P></BODY></HTML>Thu, 30 Jul 2015 11:20:59 GMThttps://community.ptc.com/t5/PTC-Mathcad/Referencing-Another-Row-in-a-Table-in-MathCad-Prime-3-1/m-p/116617#M45684StuartBruff2015-07-30T11:20:59ZRe: Referencing Another Row in a Table in MathCad Prime 3.1
https://community.ptc.com/t5/PTC-Mathcad/Referencing-Another-Row-in-a-Table-in-MathCad-Prime-3-1/m-p/116618#M45685
<HTML><HEAD></HEAD><BODY><P>Oops! The text just before the definition of h should read "In the table below, ..." and not "In the table to the left, ...". I forgot to change it after extending the Table to show the single-element array definitions.</P><P></P><P>Stuart</P></BODY></HTML>Thu, 30 Jul 2015 11:45:58 GMThttps://community.ptc.com/t5/PTC-Mathcad/Referencing-Another-Row-in-a-Table-in-MathCad-Prime-3-1/m-p/116618#M45685StuartBruff2015-07-30T11:45:58ZRe: Referencing Another Row in a Table in MathCad Prime 3.1
https://community.ptc.com/t5/PTC-Mathcad/Referencing-Another-Row-in-a-Table-in-MathCad-Prime-3-1/m-p/116619#M45686
<HTML><HEAD></HEAD><BODY><P>Hi Stuart,</P><P></P><P>From reading the help text, I (implicitly) assumed that the table is nothing more than an assembled set of variable definitions, mostly geared towards actually producing a(n input) table from column vectors. Hence my first (clumsy) example.</P><P>Especially with the remark that all possibilities of operations on/with table columns are the same as on column vectors made me stop worrying and just treat a table as a row (left to righ) of vector definitions, with the (again implicit) assumption that table elements can reference items to their left.</P><P>It wasn't until I saw your first experiments that I realized that table elements could be scalars and vectors mixed, that's nice.</P><P>The help for Prime states that tables can only be used for Input. If you want Output in a table-like form, you'll have to assemble a matrix from the vectors, but then you must be sure to fill the entire rectangle of the matrix. Fortunately matrix elements can have mixed units in Prime...</P><P></P><P>Luc</P></BODY></HTML>Thu, 30 Jul 2015 13:11:34 GMThttps://community.ptc.com/t5/PTC-Mathcad/Referencing-Another-Row-in-a-Table-in-MathCad-Prime-3-1/m-p/116619#M45686LucMeekes2015-07-30T13:11:34ZRe: Referencing Another Row in a Table in MathCad Prime 3.1
https://community.ptc.com/t5/PTC-Mathcad/Referencing-Another-Row-in-a-Table-in-MathCad-Prime-3-1/m-p/116620#M45687
<HTML><HEAD></HEAD><BODY><P>The issues is if the first column is N, the second column is M, the third column is P equal to M*N<SUB>n </SUB>/N<SUB>n+1</SUB>. This could be gear ratios and the ratio between ratios. </P><P></P><P>Is there a way to do relative addressing?</P><P></P><P>The second is that in a document it would be desirable to display the values in the table, not just the equation. After all, is the document for presentation and tables a way to enhance that?</P></BODY></HTML>Sat, 01 Aug 2015 06:06:32 GMThttps://community.ptc.com/t5/PTC-Mathcad/Referencing-Another-Row-in-a-Table-in-MathCad-Prime-3-1/m-p/116620#M45687DavidNJ2015-08-01T06:06:32ZRe: Referencing Another Row in a Table in MathCad Prime 3.1
https://community.ptc.com/t5/PTC-Mathcad/Referencing-Another-Row-in-a-Table-in-MathCad-Prime-3-1/m-p/116621#M45688
<HTML><HEAD></HEAD><BODY><BLOCKQUOTE><TABLE border="1"><TBODY><TR><TD>
<P>David Ziegelheim wrote:</P>
<P></P>
<P>The issues is if the first column is N, the second column is M, the third column is P equal to M*N<SUB>n </SUB>/N<SUB>n+1</SUB>. This could be gear ratios and the ratio between ratios.</P>
<P></P>
<P>Is there a way to do relative addressing?</P>
</TD></TR></TBODY></TABLE></BLOCKQUOTE><P></P><P>OK. What I suspect you're really after is a "spreadsheet" way of relating the columns; that is, writing an expression for the value of P in each "cell" of the table, where the expression depends upon the "row number" of elements in another column, and then displaying the result rather than the expression??</P><P></P><P>If so, then the answer is that you can't as that as a table isn't actually a spreadsheet-like table. As stated above, a table is just another way of writing a set of (possibly related) Mathcad statements. So anything (well, almost anything) you can write in Mathcad normally, should be capable of being written in a table. So, in your particular example, we'd have:</P><P></P><P><IMG alt="" class="jive-image image-1" src="https://community.ptc.com/legacyfs/online/90224_pastedImage_1.png" style="max-width: 1200px; max-height: 900px;" /></P><P>As Luc points out, a Mathcad table is just an alternative form for Input of expressions; Mathcad does not allow you to output data in table form. So once you've got the data, you have to find an alternative method of formatting the data how you'd like it. I occasionally have the need to display data in tabualar format with heading; when I do I either use Excel or a simple Table function like the one below (transcribed from Mathcad 15 into Express (which lacks programming)).</P><P></P><P><IMG alt="" class="jive-image image-2" src="https://community.ptc.com/legacyfs/online/90225_pastedImage_3.png" style="max-width: 1200px; max-height: 900px;" /></P><P>(Note that I had to manually adjust the size of P to make it equal in length to N ... the advantage of Excel (and the new Prime table input method) is that I don't have to worry about that particular detail)</P><P></P><P>Stuart</P></BODY></HTML>Sat, 01 Aug 2015 08:43:16 GMThttps://community.ptc.com/t5/PTC-Mathcad/Referencing-Another-Row-in-a-Table-in-MathCad-Prime-3-1/m-p/116621#M45688StuartBruff2015-08-01T08:43:16Z