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?
1 Answer
$\begingroup$
$\endgroup$
2
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}]
-
$\begingroup$ 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 $\endgroup$– OKCarlCommented Jul 19, 2020 at 2:32
-
1
dtpts1a={{X,n*Y},{X,n*Y},{X,n*Y}...
and then have slider forn
to change it. $\endgroup$MapAt[n*#&, dtpts1a, {All,2}]
$\endgroup$dtpts1a.{{1, 0}, {0, .5}}
$\endgroup$