# Question about Working with Lists / Tables

I have a data point set embedded in a manipulate. dtpts1a={{X,Y},{X,Y},{X,Y},{X,Y},{X,Y},{X,Y},{X,Y}, and so on and so forth, continuing} How do I alter, how do I change the magnitude of each dependent variable (Y)? I would like to multiply each Y value, all at the same time, with some kind of a function under the control of a slider bar. Like this, {{X,0.5Y},{X,0.5Y},{X,0.5Y}}} or possibly, {{X,2Y},{X,2Y}},{X,2Y}}}. Ideas? Suggestions?

• you could write it as dtpts1a={{X,n*Y},{X,n*Y},{X,n*Y}... and then have slider for n to change it. Jul 18 '20 at 21:23
• Yes, that would work. But I'm hoping for something easier. My data set sums to 128 point pairs {{X,Y}} Jul 18 '20 at 23:04
• You can use Nasser's solution with MapAt[n*#&, dtpts1a, {All,2}] Jul 18 '20 at 23:32
• You could use a dot product: dtpts1a.{{1, 0}, {0, .5}} Jul 19 '20 at 0:21

dtpts1a = Table[RandomInteger[{1,100}],{i,128},{j,2}];

Manipulate[
MapAt[n*#&, dtpts1a, {All,2}]
,{n,0,1}]


EDIT

By default Manipulate uses steps of 10^-3 * rangeMax for the variable. You can decrease the step size and use SetAccuracy to always show four digits

Manipulate[
SetAccuracy[MapAt[n*#&, dtpts1a, {All,2}],5]
,{n,0,1,0.0001}]

• Mister Hausdorff's solution works. dtpts1c=MapAt[n*# &, dtpts1a,{All, 2}]; One last question. How do I "SetPrecision" for the output? I am wanting four significant figures for each one of my calculated dependent variables. Thanks in advance. OKCarl Jul 19 '20 at 2:32
• I just edited my answer Jul 19 '20 at 8:30