| Contents | Index |
plot::Sum(ex, i = m..n) creates a plot of summing ex over the range m..n.
Calls:
plot::Sum(ex, i = m .. n, <a = amin .. amax>, Options)
plot::Sum(sum(ex, i = m .. n), <a = amin .. amax>, Options)
Parameters:
|
ex: |
arithmetical expression in i and the animation parameter a, if that is used. |
|
i: |
an identifier or indexed identifier. |
|
m .. n: |
the range of i. m and n may be expressions in the animation parameter a. Summation goes over m + integer. If n - m is not an integer, n will not be reached. |
See Also:
plot, plot::copy, plot::Function2d, plot::PointList2d
Details:
plot::Sum creates a visual display of partial sums over a finite interval. Mathematically, plot::Sum(ex, i = m..n) plots the function
.
To ease the use of plot::Sum in programs, symbolic sums are accepted in the input and plot::Sum takes care not to evaluate these. It is highly recommended, though, not to use this syntax in interactive applications, to avoid premature evaluation.
Example 1
It is well known that
. We use plot::Sum to display the first
partial sums:
plot(plot::Sum(1/j^2, j = 1..100),
plot::Function2d(PI^2/6, x=1..101, LineStyle = Dashed))

With more partial sums, the steps approximate points:
plot(plot::Sum(sin(j^2)/j, j=1..500))

Example 2
To show some of the formatting options of plot::Sum, we use the following sum:
s := plot::Sum(1/j, j = 1..20)
![]()
By default, this object is displayed as follows:
plot(s)

To change parameters, we can select them in the inspector and change the values, we can give other values directly in the plot command or we can set the new values in our object s:
s::PointsVisible := TRUE:
s::LinesVisible := FALSE:
s::PointColor := RGB::Green:
plot(s)

Example 3
plot::Sum allows animation in the usual way, for example, in the term to sum:
plot(plot::Sum(sin(a*i^2)/i, i = 1..50, a = 0..PI))


Another interesting parameter to animate is the summation range:
plot(plot::Sum((-1)^j/j, j = 1..jmax, jmax = 1..50))



Includes the most popular MATLAB recorded presentations with Q&A sessions led by MATLAB experts.
| © 1984-2012- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |