Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations KootK on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Creating a table or matrix of several range variables results in Mathcad Prime 4.0 1

Status
Not open for further replies.

rpherman

Mechanical
Jul 30, 2020
7
I have calculated some results over a range of angles, and I can only display the results in separate columns.
How can I put them into a single table or matrix for presentation, not further calculation?

Edit: I am using Mathcad Prime 4.0


Range_variable_results_je1nwv.png
 
Replies continue below

Recommended for you

Not sure what the current configuration of Mathcad does, but typical version requires removing the units and then using something like the "augment" or "stack" functions. You could try augment without getting rid of the units and see what happens.

TTFN (ta ta for now)
I can do absolutely anything. I'm an expert! faq731-376 forum1529 Entire Forum list
 
I tried, but removing units causes all sorts of inconsistencies.

I tried dividing omega_i by 1 * deg to rid the deg unit, but no luck.

"The value must be an integer." is another error it throws.

Am I missing something?
 
Can you post the worksheet? Your experience does not sound like what should happen.

Oh, never mind, what is the i subscript? Again, having the worksheet instead of pictures would make some of the question go away and get closer to the actual problem

TTFN (ta ta for now)
I can do absolutely anything. I'm an expert! faq731-376 forum1529 Entire Forum list
 
Only thing I can think of is that you are including the index, because it messes things up when you do that. Your index is also funky, since you wind up with 91 elements in each vector, but only 19 are non-zero
mat_sawebg.png


TTFN (ta ta for now)
I can do absolutely anything. I'm an expert! faq731-376 forum1529 Entire Forum list
 
The index is based upon integers from 0 to 90 of units of deg. That's the 91 elements, however, I created it with a step of 5 as you have in the worksheet I shared. i = 1,5..90.

Why would it put zeros in?

Weird. Thanks for your efforts.

Rob

Edit: If I make i := 1,..90, I lose the zeros but now I have a 91 row table! Why would augment ignore the step and put a zero in the rows in between? TTYL
 
I get 0-indexing. I program in APL and J. What I meant was I setup the i variable to start at 0, end at 90, in 5 increments or steps for a total of 19 indices.

SMath Studio gets it right as you can see in the screencap below.

SMathStudio-Augment-example-works_xpxdc8.png


Thanks for your help anyway! It is much appreciated.

Rob
 
Mathcad does not work that way; index increments are always 1, only. Your definition results in allocating 91 indexed entries; which are initialized to zero, hence the results.

TTFN (ta ta for now)
I can do absolutely anything. I'm an expert! faq731-376 forum1529 Entire Forum list
 
Oh, but Mathcad does seem to work that way per the worksheet I shared and the simple example below. It can step in 5 or any other integer, not just 1. Simply define n := 0,5..90, and you get 19 elements, not 91. The issue of the zeros seems to come up when you have units in Mathcad. Units still work in SMath Studio without putting in the zeros or extra rows, so Mathcad does put in the zeros compared to it; I'm not. Thanks!

Mathcad_range_without_zeros_xkxtev.png
 
I really appreciate your help! Thank you!

I'm going to drop this for now, and use SMath Studio or Mathematica.

Rob
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor