0
$\begingroup$

How can I "change" the values in the list h={2,4,6} using Manipulate?

(Next line was edited after hte first Alexi´s comment) I WANT to choose real values in h[[1]], h[[3]] , h[[3]] between 0 and 8.

I was trying, typing at the final line

{h[[1]],1,8},{h[[2]],1,8},{h[[3]],1,8},{zmax, Range[8]}

instead

{zmax, Range[8]}

But I obtain this error: Manipulate::vsform: "Manipulate argument {h[[1]],1,8} does not have the correct form for a variable specification"


Manipulate[

 h = {2, 4, 6};

 Column[{
   Row[{

     TableForm[Table[h^z, {z, 1, zmax}], 
      TableHeadings -> {None, {"Number", "Square", "Cube"}}]
     }
    ],

   Row[{
     PieChart[Table[i^2, {i, 1, zmax}], ChartLabels -> Range[zmax], 
      ImageSize -> 200],

     PieChart[Table[i^3, {i, 1, zmax}], ChartLabels -> Range[zmax], 
      ImageSize -> 200],

     PieChart[Range[zmax], ChartLabels -> Range[zmax], 
      ImageSize -> 200]
     }
    ]
   }]
 , {zmax, Range[8]}]
$\endgroup$
2
  • $\begingroup$ This strongly depends upon What do you want to achieve? This is not clear from your post. $\endgroup$ Apr 10, 2014 at 14:36
  • $\begingroup$ \alexei-boulbitch I WANT to choose real values in h[[1]], h[[3]] , h[[3]] between 0 and 8. This is a little to ilustrate me for a major progrma that I´m doing for a personal math program. $\endgroup$
    – Mika Ike
    Apr 10, 2014 at 14:53

1 Answer 1

2
$\begingroup$

Try this:

    Manipulate[
 h = {h1, h2, h3};
 Column[{Row[{TableForm[Table[h^z, {z, 1, zmax}], 
      TableHeadings -> {None, {"Number", "Square", "Cube"}}]}], 
   Row[{PieChart[Table[i^2, {i, 1, zmax}], ChartLabels -> Range[zmax],
       ImageSize -> 200], 
     PieChart[Table[i^3, {i, 1, zmax}], ChartLabels -> Range[zmax], 
      ImageSize -> 200], 
     PieChart[Range[zmax], ChartLabels -> Range[zmax], 
      ImageSize -> 200]}]}], {zmax, Range[8]}, {h1, 0, 8}, {h2, 0, 
  8}, {h3, 0, 8}]
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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