cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - When posting, your subject should be specific and summarize your question. Here are some additional tips on asking a great question. X

Only outputting single point when trying to plot a function

WP_10142165
3-Visitor

Only outputting single point when trying to plot a function

Heya, I've been looking everywhere, I've been following basic plotting tutorials, but I cannot for the life of me find a way to plot my function. Each time I try I just get a single point on the y-axis. Any help would be incredibly appreciated. 

WP_10142165_0-1639007525364.png

 

1 ACCEPTED SOLUTION

Accepted Solutions


@WP_10142165 wrote:

Heya, I've been looking everywhere, I've been following basic plotting tutorials, but I cannot for the life of me find a way to plot my function. Each time I try I just get a single point on the y-axis. Any help would be incredibly appreciated. 

WP_10142165_0-1639007525364.png


 

2021 12 09 a.png

 

2021 12 09 b.png

 

If you put an evaluation operator at the end of a definition involving a range variable, Mathcad has a (nasty/useful) trick of converting the range to a vector.   There are some who find this a useful thing as a means of creating vectors.  I generally avoid the practice like the plague as it can catch even the experienced out and, apart from vectors, the output can bear little resemblance to what's stored in the defined variable.

 

BTW, it's good practice to post your worksheet when asking for assistance with problems.   Sometimes, the source of the problem can be difficult to pin down without having the worksheet to look at (constant/variable definitions are a good example!).   🙂

 

Stuart  

View solution in original post

6 REPLIES 6


@WP_10142165 wrote:

Heya, I've been looking everywhere, I've been following basic plotting tutorials, but I cannot for the life of me find a way to plot my function. Each time I try I just get a single point on the y-axis. Any help would be incredibly appreciated. 

WP_10142165_0-1639007525364.png


 

2021 12 09 a.png

 

2021 12 09 b.png

 

If you put an evaluation operator at the end of a definition involving a range variable, Mathcad has a (nasty/useful) trick of converting the range to a vector.   There are some who find this a useful thing as a means of creating vectors.  I generally avoid the practice like the plague as it can catch even the experienced out and, apart from vectors, the output can bear little resemblance to what's stored in the defined variable.

 

BTW, it's good practice to post your worksheet when asking for assistance with problems.   Sometimes, the source of the problem can be difficult to pin down without having the worksheet to look at (constant/variable definitions are a good example!).   🙂

 

Stuart  


@StuartBruff wrote:

2021 12 09 a.png

 

If you put an evaluation operator at the end of a definition involving a range variable, Mathcad has a (nasty/useful) trick of converting the range to a vector.   


Forgot to add ...

 

The reason you are seeing a single point is that squaring a vector returns its dot product (single value).  If you want to use vectors, it's generally a good idea to check the numeric values and use the vectorize operator to apply functions/expressions to each element of a vector (or matrix).

 

2021 12 09 c.png

 

2021 12 09 d.png

 

Stuart 

Thank you so much! That's great to know. About adding the worksheet, I was fairly certain I attached it to the main post. Is there a better way to share it?


@WP_10142165 wrote:

Thank you so much! That's great to know. About adding the worksheet, I was fairly certain I attached it to the main post. Is there a better way to share it?


It looks like you did add it - I can see it now.   I sometimes suspect that there can be a bit of a delay between items appearing after posting/loading.   Either that or I *really* do need to get my eyes/brain checked again! 🤓

 

Stuart

Yes, you did attach the worksheet, Nothing wrong in doing so.
Probably the attached sheet was virus checked and so the attachment may show up a little later than the body of the post.
I am not sure about that, but it could be an explanation why Stuart saw now attachment in first place.

BTW, you sure want a range variable with a smaller step width and you also may consider manually changing the axis values as Primes automatic usually does a quite bad job here.
You can edit the first, second and last value on each axis

Werner_E_0-1639010586451.png

 

 

 

Thanks for the tip, you're right, ms does seem to be the better choice, and decreasing the step makes a huge difference.

 

Thanks!

Top Tags