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
- :
- Plot function

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

02-12-2015
01:01 PM

02-12-2015
01:01 PM

Plot function

We want to define a function that gives the values

f (a) = 2a when a is between 0 and 5

f (a) = 10 when a is between 5 and 10

f (a) = 0 all other times

and then plot the function with that range −5 < a < 15

I have tried it but my plot just don't seem right look at the attachment. can you show me how to do it in MATHCAD

2 REPLIES 2

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

02-12-2015
01:45 PM

02-12-2015
01:45 PM

Re: Plot function

I have tried it but my plot just don't seem right look

Why? Your plot is showing exactly what you want with just one exception - there is nothing plotted in the range from-5 to 0, because your function is not providing values for a<0. This can be repaired if you replace the last if-statement by an otherwise-statement.

For further questions please note that its adviseable to attach your worksheet, not just a screenshot.

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

02-12-2015
01:52 PM

02-12-2015
01:52 PM

Re: Plot function

What you have is correct (or almost correct, anyway). What makes you think it's wrong?

The graph would look better if you changed the y axis limits a little. If you click on the plot you will see placeholders at the top and bottom of the axis. Try typing in -1 and 11 for the limits.

Also, your function is technically not quite correct. The second line says that if a=10 then the result should be 10, but the third line says if a=10 then the result should be 0. The statements should not overlap. Also, replace the last one with "otherwise", which also covers the case when a<0.

Top Tags