0
$\begingroup$

enter image description here

Here, i have plotted a function and i would like to print the y coordinate values from the plot for the x-coordinate given below. Coordinates in the sequence that every fourth y-coordinate should be repeated.

{ 0.,2000.,4000,6000,6000, 8000., 10000., 12000.}

analyticPlot = Plot[HeavisideTheta[9600 - 2 x], {x, 2400, 8400},
  PlotRange -> Full,
  PlotStyle -> Red
  , PlotLegends -> Placed[{"analytic"}, {Right, Center}]
  , Epilog -> {{Dashed, Red, Thick, Line[{{9600/2, 0}, {9600/2, 1}}]}}
  , LabelStyle -> Directive[20, FontFamily -> "Latin Modern Roman"]]
[![sharp front][1]][1]

I have tried with the syntax like "evaluate and Table" but could not worked .

$\endgroup$
6
$\begingroup$

What about

HeavisideTheta[9600 - 2 {0., 2000., 4000, 6000, 6000, 8000., 10000., 12000.}]
(*{1, 1, 1, 0, 0, 0, 0, 0}*)
| improve this answer | |
$\endgroup$
  • $\begingroup$ Yes, this could be done. But given x coordinates are just for the example. Actualy required is more than 10000 coordinates. $\endgroup$ – user75507 Nov 16 at 14:30
  • $\begingroup$ Yes, this could be done. But given x coordinates are just for the example. Actually required is more than 10000 coordinates. I have numerical solution and want to compare with analytic one. The numerical solution is for the the x-coordinate. For the same x-coordinate need to print the y values which will be analytic solution. $\endgroup$ – user75507 Nov 16 at 14:40
  • $\begingroup$ You look for all the plotted x-values? $\endgroup$ – Ulrich Neumann Nov 16 at 14:49
  • $\begingroup$ Yes. So that I can find the difference between analytic and numerical solution which will give me exact error value. $\endgroup$ – user75507 Nov 16 at 15:20
  • 1
    $\begingroup$ Cases looks inside expression analyticPlot for Line- objects and returns the argument( points!) of Line. $\endgroup$ – Ulrich Neumann Nov 18 at 7:32

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