Question: It doesn't show me the plot in if/for statement

Hi everybody,

I have just started to learn using maple and now I have a trouble.

I thought programming was similar to C language, and I tried to write this simple code:

> restart:
> a := 2;
   b := 5;
>
> for i from 1 by 1 to 4 do
   if a = b then 
        print('before'); 
        plot(x^2, x = -2 .. 2); 
        print('later')
   end if; 
   a := a+1 
   end do;
 

I thought that the output of this code should has been, when a=5, a string 'before', a plot, and a string 'later'.

Instead I obtain only the two strings, without any plot! How can I obtain this plot too??

I hope my question is clear.

Thank you for helping.

Bye

 

Andrea

Please Wait...