18.01.2015 Views

Appunti di Calcolo Numerico - Esercizi e Dispense - Università degli ...

Appunti di Calcolo Numerico - Esercizi e Dispense - Università degli ...

Appunti di Calcolo Numerico - Esercizi e Dispense - Università degli ...

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.

CAPITOLO 12<br />

Primi passi in MATLAB®<br />

L’universo non potrà essere letto<br />

finché non avremo imparato il<br />

linguaggio ed avremo familiarizzato<br />

con i caratteri con cui è scritto. È<br />

scritto in linguaggio matematico, e<br />

le lettere sono triangoli, cerchi ed<br />

altre figure geometriche, senza le<br />

quali è umanamente impossibile<br />

comprendere una singola parola.<br />

Galileo Galilei<br />

12.1 Introduzione . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 183<br />

12.2 Avvio <strong>di</strong> MATLAB® . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 184<br />

12.2.1 Matrici e vettori in MATLAB® . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 185<br />

12.3 Coman<strong>di</strong> utili . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 187<br />

12.4 MATLAB® per scrivere ed eseguire programmi . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 188<br />

12.4.1 Strutture . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 188<br />

12.5 Dati <strong>di</strong> input . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 190<br />

12.5.1 Programma sul metodo delle bisezioni . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 191<br />

12.6 Dati <strong>di</strong> output . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 192<br />

12.7 Grafici . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 193<br />

12.8 Sulle potenzialità <strong>di</strong> MATLAB® . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 194<br />

12.9 Applicazioni <strong>di</strong> MATLAB® nel <strong>Calcolo</strong> <strong>Numerico</strong> . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 194<br />

12.9.1 Sull’instabilità numerica . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 194<br />

12.9.2 Sull’interpolazione e approssimazione <strong>di</strong> dati . . . . . . . . . . . . . . . . . . . . . . . . . . 195<br />

12.9.3 Confronto tra schemi per equazioni <strong>di</strong>fferenziali or<strong>di</strong>narie . . . . . . . . . . . . . . . . . . 202<br />

12.1 Introduzione<br />

Questo capitolo è provvisorio. Infatti, in origine, era stato pensato come una semplice introduzione a<br />

MATLAB® , per chi aveva già imparato a usare il FORTRAN. Molte cose non sono quin<strong>di</strong> approfon<strong>di</strong>te<br />

come dovrebbero! Approfon<strong>di</strong>menti e integrazioni al presente capitolo saranno <strong>di</strong>sponibili durante il<br />

corso: tenere d’occhio, quin<strong>di</strong>, il sito delle <strong>di</strong>spense!!!<br />

MATLAB® può essere considerato un linguaggio <strong>di</strong> programmazione ad alto livello e, allo stesso tempo,<br />

un ambiente interattivo per lo sviluppo <strong>di</strong> algoritmi, per la visualizzazione e l’analisi <strong>di</strong> dati, e per il calcolo<br />

numerico.<br />

183

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

Saved successfully!

Ooh no, something went wrong!