18.08.2013 Views

Scilab 2 - Robotica

Scilab 2 - Robotica

Scilab 2 - Robotica

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Le stringhe I numeri interi Strutture di controllo<br />

L’istruzione while<br />

i = 11; // per esempio...<br />

while (i ~= 1)<br />

if (modulo(i, 2) ~= 0) then<br />

i = 3 * i + 1;<br />

else<br />

i = int(i / 2);<br />

end<br />

disp(i)<br />

end<br />

la funzione modulo(x, y)<br />

calcola il resto della divisione intera x/y<br />

Tullio Facchinetti CNeP: Introduzione a <strong>Scilab</strong> (2)

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!