1 / 5

MATLAB - PowerPoint PPT Presentation

MATLAB. Prvi koraki. Določene operacije. A = [12, 5; 3, 11] min(A) max (A) sum(A) diag (A). "Rezanje" matrik. Element A(2,3) Podmatrika A(2:4, 1:3) Vrstica A(2,:) Stolpec A(:,4). Komentiranje. % začne komentar matI = eye (5) % matI je identična matrika velikosti 5. Naloga.

I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.

PowerPoint Slideshow about 'MATLAB' - mliss

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.

- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript

MATLAB

Prvi koraki

• A = [12, 5; 3, 11]

• min(A)

• max(A)

• sum(A)

• diag(A)

• Element

• A(2,3)

• Podmatrika

• A(2:4, 1:3)

• Vrstica

• A(2,:)

• Stolpec

• A(:,4)

• % začne komentar

• matI = eye(5) % matI je identična matrika velikosti 5

• Sestavi magični kvadrat velikosti 5 x 5 in preveri, če je vse OK (diagonali, stolpci in vrstice seštejejo v isto vsoto)

• helpmagic

• magKv = magic(5)

• Hura – le še kontrole

• sum(magKv)

• Vsote po stolpcih

• Kaj pa po vrsticah?

• Sum(magKv')

• Preverimo glavno diagonalo

• sum(diag(magKv))

• Kaj pa obratna?

• Pomoč …

• rot90

• sum(diag(rot90(magKv)))