Get Help

Turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

- Community
- :
- PTC Mathcad
- :
- PTC Mathcad
- :
- Easy question for Mathcad Users

Options

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

Highlighted

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

09-12-2014
04:38 PM

09-12-2014
04:38 PM

I am very beginner user for MathCAD 15.

I have a trouble that I cannot solve myself.

What am I doing wrong in this code ?

Solved! Go to Solution.

Labels:

1 ACCEPTED SOLUTION

Accepted Solutions

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

09-12-2014
05:08 PM

8 REPLIES 8

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

09-12-2014
05:08 PM

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

09-12-2014
05:17 PM

09-12-2014
05:17 PM

Re: Easy question for Mathcad Users

Much simpler approach.

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

09-12-2014
07:59 PM

09-12-2014
07:59 PM

Re: Easy question for Mathcad Users

Ashley Diana Hogg wrote:

I am very beginner user for MathCAD 15.

I have a trouble that I cannot solve myself.

What am I doing wrong in this code ?

Its hard to debug a picture - you'd better had posted the worksheet itself.

Best guess is that you have not changed the default value of ORIGIN, so its still zero (which is a good idea anyway) but you used a range from 1 to 5 to loop through your vector Grades. Vectors are indexed beginning with the value of ORIGIN, so by default for a 5 element vector this will be 0 to 4. So the usage of 5 may have thrown that error.

As Moe has already shown the task can be acomplished in a much simpler way. If you prefer the functional approach, you may use this:

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

09-14-2014
05:31 PM

09-14-2014
05:31 PM

Re: Easy question for Mathcad Users

thank you so much to all of you for your answers.

im wondering one more thing, if you will help me again.

we have written that :

for i 0..last(x)

is the "last" word a command for mathcad ? or how does it know that what is last ?

and also the term "rows(x)" does mathcad know what "rows" mean when we write that word ourselves?

for instance sum is a word that we define ourselves completely.

i hope i could state myself clearly.

sorry, i have missed that point, for the rest that is completely helpful.

And other answers also have given me so much thoughts for more advanced to me. thank you.

To, improve myself, can you please help me to find such examples ?

or can you lead me please ?

im a student that i have assigned for this lesson and moreover i wanna continue studying on mathcad.

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

09-14-2014
05:47 PM

09-14-2014
05:47 PM

Re: Easy question for Mathcad Users

for the summation symbol, what should i write for the variable ?

mathcad askes me to define a variable ?

i know there are 2 symbols but i have chosen the simple one that does not require boundaries

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

09-14-2014
07:19 PM

09-14-2014
07:19 PM

Re: Easy question for Mathcad Users

Ashley Diana Hogg wrote:

for the summation symbol, what should i write for the variable ?

mathcad askes me to define a variable ?

i know there are 2 symbols but i have chosen the simple one that does not require boundaries

There are actually three summation symbols in Mathcad.

One following the usual mathematical convention with summation variable and lower and upper boundary, the second with only a placeholder at the bottom which should be filled with a range variable and the third without any placeholder (other than the one to hold the expression to be summarized). I used the latter which is to be used to sum up the elements of a vector.

The argument x of the function class has to be a vector of grades. x>=60 creates a vector consisting of 1's and 0's, depending on if the condition is true or not. The sum of this vector therefore gives the number of students having passed the test.

rows, cols, last are predefined Mathcad functions which work on vectors. Look it up in the help. The help in Mathcad is very useful - give it a try.

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

09-15-2014
11:29 AM

09-15-2014
11:29 AM

Re: Easy question for Mathcad Users

last(x) and rows(x) are built-in Mathcad functions. You can get a description of their use in the help documentation.

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

09-18-2014
05:22 PM

09-18-2014
05:22 PM

Re: Easy question for Mathcad Users

thank you for your greate answer.