Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

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]}]
share|improve this question
    
This strongly depends upon What do you want to achieve? This is not clear from your post. –  Alexei Boulbitch Apr 10 at 14:36
    
\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. –  Mika Ike Apr 10 at 14:53
add comment

1 Answer 1

up vote 2 down vote accepted

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}]
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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