Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

I try to show the convolution of a step function and a triangle function is smooth with the following code:

Manipulate[f0 = UnitBox[p - t0]; f1 = 2 UnitTriangle[t0]; 
 f2 = Convolve[f0, f1, t0, t1];
 Plot[{f0, f1, f2} /. {t0 -> x, t1 -> x}, {x, -3, 3}], 
{{p, -2}, Locator}]

It should be something like this:

The original PIC

But after have a click to locate the Locator, it seems Mathematica have plot some "non-necessary" curves (I have marked by red cross):

After cilck

How the get the right plot?

share|improve this question
add comment

1 Answer

up vote 2 down vote accepted

I'm not really sure what you expect, because a Locator is clearly a point {x,y}. Even if you initialize it with -2, after the first click, it is converted to a point, thus the behavior.

Manipulate[f0 = UnitBox[First[p] - t0]; f1 = 2 UnitTriangle[t0];
 f2 = Convolve[f0, f1, t0, t1];
 Plot[{f0, f1, f2} /. {t0 -> x, t1 -> x}, {x, -3, 3}], {{p, {-2, 0}}, 
  Locator}]

Mathematica graphics

share|improve this answer
    
I see, it is exactly as you point out, it is a point!!! –  van abel Oct 19 '13 at 4:44
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.