0
$\begingroup$
DiscretePlot[
  {117 (Cos[
     10 x + 28.58 - .19 UnitBox[100 x - 1] - .19 UnitBox[
     100 x - 10] - .19 UnitBox[100 x - 20] - .19 UnitBox[
     100 x - 35]]^2)}, {x, 0, .40, .001}, 
  LabelStyle -> Directive[Black, 20], 
  PlotStyle -> {Automatic, Thickness[.004]}, 
  Method -> {"AxesInFront" -> False}, ImageSize -> 500, Frame -> True, 
  GridLines -> Automatic, PlotMarkers -> Automatic, PlotRange -> All]

fig

I want to subtract the (more than 10th term) unitbox from the phase of the sinusoidal curve. How could I use Table to make the plot shown above.

I used expression given below, but it does not work.

Cos[10 x - Table[.19 UnitBox[250 x - s], {s, 1, 10, 1}]]^2
$\endgroup$
1
$\begingroup$

Try this:

Plot[117*Cos[
  10 x + 28.58 - .19 *
    Plus @@ (UnitBox[100 x - #] & /@ {1, 10, 20, 35})], {x, 0, 0.40},
  Exclusions -> False]

plot

Have fun!

$\endgroup$
  • $\begingroup$ Thanks @ Alexei $\endgroup$ – Gopal Verma Nov 6 '18 at 17:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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