I'd like to vary a factor in a matrix calculation, so I have used Module
to make it happened, but it doesn't work. Below is a code example. can someone tell me how to fix it? It would be appreciated.
polardata[omega_] :=
Module[{},
matrix = Flatten[RandomReal[0.5, {1, 6}], 1];
intermediate = omega*matrix;
addition = Flatten[RandomReal[0.5, {1, 6}], 1];
polardata = Join[intermediate, addition]]
Manipulate[
ListPolarPlot[polardata[omega], DataRange -> {0, 2 π},
Joined -> True],
{omega, 0.1, 1.0}]
polardata
inside the definition forpolardata
, you are wiping theModule
definition as soon as you evaluate it. Just take thepolardata =
out of the last line of theModule
and you are fine. $\endgroup$