[Scilab-users] update script to Scilab 6.00

Hermes herozigle at gmail.com
Tue Sep 19 13:51:56 CEST 2017


how to update this script to scilab 6.00. I really do not know where and how
to substitute ¨pixmap¨ for drawlater and drawnow and get the animation as
good as shown on the source website of the script

//http://www.ulb.ac.be/polytech/smana/TUTORIAL.htm
<http:////http://www.ulb.ac.be/polytech/smana/TUTORIAL.htm>  
function dy=fon(t, y)
global g l 
dy(1) = y(2);
dy(2)=-g/l*sin(y(1)); 
endfunction
 
teta_init = 45;teta_init=teta_init/180*pi;dteta_init = 0;
g=9.81;l=1;
t=0:0.1:20;
y=ode([teta_init;dteta_init],0,[t],fon);
 
//Preparation du graphe
f = gcf(); // on recupere le handle de la fen^etre graphique
f.pixmap = "on"; // on met la fenetre en mode double buffer
f.background = color("white");
f.foreground = color("white");;
//FIN Preparation du graphe
 
i = 1;
while i<=length(y)  
  i = i+1;  
  
  clf(); // On efface l'image précédente - on évite le scintillement
  xtitle('', 'm', 'm');  
  a = gca(); // On récupère l'objet graphique axes pour modifier les
légendes
  a.isoview = "on"; a.data_bounds = [-2 2 -2 2];  a.title.text = "Le pendule
";
  a.title.font_size = 4; a.title.foreground = color("white");
  a.background = color("white");;
 
  xpoly([0  +l*sin(y(1,i))],[0 -l*cos(y(1,i))],"lines",0)
  ep = gce(); // On récupère l'objet graphique double-pendule atwood 
              // pour modifier son aspect cosmétique
  ep.thickness = 3;ep.foreground = color("blue");
  
 
plot([+l*sin(y(1,i))],[-l*cos(y(1,i))],'o','MarkSize',10,'MarkBackground','b')
  xgrid(12)
  show_pixmap() // basculement de la pixmap a l'ecran
end
f.pixmap = "off"; // on remet la fen^etre en mode usuel


Gracias



--
Sent from: http://mailinglists.scilab.org/Scilab-users-Mailing-Lists-Archives-f2602246.html



More information about the users mailing list