08.07.2015 Views

Introduction to MATLAB 7 for Engineers Chapter 1 An ... - FET

Introduction to MATLAB 7 for Engineers Chapter 1 An ... - FET

Introduction to MATLAB 7 for Engineers Chapter 1 An ... - FET

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.

A simple example of a <strong>for</strong> loop ism = 0;x(1) = 10;<strong>for</strong> k = 2:3:11endm = m+1;x(m+1) = x(m) + k^2;k takes on the values 2, 5, 8, 11. The variable mindicates the index of the array x. When the loopis finished the array x will have the valuesx(1)=14,x(2)=39,x(3)=103,x(4)=224.1-51

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

Saved successfully!

Ooh no, something went wrong!