PatrickT

Dr. Patrick T

2153 Reputation

18 Badges

16 years, 206 days

MaplePrimes Activity


These are questions asked by PatrickT

To plot the density function of the continuous uniform distribution on [-1,1], my initial attempt was: 

plot(Statistics:-PDF(Statistics:-RandomVariable(Uniform(-1,1)),x), x = -1.1 .. 1.1);

See plot below.


But I wanted something more like the wikipedia image (without the labels, naturally):

See plot below.

In words, I expected a horizontal line on the left of x=-1 and on the right of x=1 (at y=0), and I expected no vertical line at the x=-1 and x=1 points ...

When exporting plots some labels are occasionally cropped. This is true when exporting via the context menu or with plotsetup('gif', etc.) for instance (plotsetup also drops the third label in 3D plots, the context menu keeps it).

I discovered that scaling the plot from the context menu can help: is there a programmatic way to control the plot scale?

From the context menu: Manipulator -> Scale, the plot can be rescaled to ensure that all...

I noticed the following behaviour in Maple 16:

x1 := (a)^(b):
eval(x1,[a=103/100]):
evalf[3](%);

                                 b
                             1.03

I have two problems with type declarations in procedures. They seem to be related, so I'll ask both questions at once.

1. One problem is that I make this sort of declaration.

{[n,N]::positive:=1}

where n could be an integer or a float, but not negative nor complex. I'm not sure what's wrong with the code below: the type-checking fails, but I don't understand why. I followed the template laid out by Preben here:
http://www.mapleprimes.com/questions/134550...

A simple question. I have looked at the help pages on "passing" and "declaring" arguments, which are very detailed, but couldn't quite spot the answer to my question, though I suspect it is there somewhere.

I have 2 procedures and want to pass the argument of one procedure to another procedure used therein. In the basic case, I seem to be able to do it without special precautions. However, I have not been able to make it work in a situation involving multiple spellings for the arguments ...

1 2 3 4 5 6 7 Last Page 2 of 13