array made of an infinite number of elements
Show older comments
Hi, the smaller I make t, the more precise the shape of c becomes, but is there a simple way to see what c would look like if t was infinitely small?
t=0.002;
a=(0:t:2)';
b=(-10:0.001:10);
c=sum((sin(bsxfun(@times,b,((pi*2)*a)))),1);
plot(b,c)
Accepted Answer
More Answers (1)
Wayne King
on 4 Dec 2013
Edited: Wayne King
on 4 Dec 2013
Do you have the Symbolic Toolbox, if so you can determine limits
syms x
limit(sin(x)/x)
to find the limit at a particular value,
syms x
limit(exp(-x^2),inf)
That isn't exactly what you're asking, but other than simply making your increment smaller that's all you can do.
You can also plot symbolically:
syms x;
ezplot(sin(x)/x,[-10 10])
1 Comment
Walter Roberson
on 4 Dec 2013
And to answer the implied other half of the question: there is no way to handle infinity numerically.
For example for sin(x) you can poke around numerically near the upper limits of numeric precision of MATLAB, and you would deduce some particular value for the limit, but in fact limit sin(x) is undefined rather than any particular number.
Categories
Find more on MuPAD in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!