tema_cna_3_Cosma - Cosma Mihai gr 331AA Tema laborator 3 1...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
Cosma Mihai gr. 331AA Tema laborator 3 1. Programele MatLab de la punctele 1, 2, 3 ale laboratorului. a) Algoritmul 3.1 (Date matricea simplă n n C A × si funcţia C C f definită pe spectrul matricei A, algoritmul calculează F = f(A) prin determinarea valorilor şi vectorilor proprii.) function F = f_vp(A, f) [n, n] = size(A); [V, L] = eig(A); D = zeros(n, n); for i = 1 : n D(i, i) = feval(f, L(i, i)); end Verificare: >> A = rand(10) A = 0.5828 0.2091 0.4154 0.2140 0.6833 0.4514 0.6085 0.0841 0.1210 0.2319 0.4235 0.3798 0.3050 0.6435 0.2126 0.0439 0.0158 0.4544 0.4508 0.2393 0.5155 0.7833 0.8744 0.3200 0.8392 0.0272 0.0164 0.4418 0.7159 0.0498 0.3340 0.6808 0.0150 0.9601 0.6288 0.3127 0.1901 0.3533 0.8928 0.0784 0.4329 0.4611 0.7680 0.7266 0.1338 0.0129 0.5869 0.1536 0.2731 0.6408 0.2259 0.5678 0.9708 0.4120 0.2071 0.3840 0.0576 0.6756 0.2548 0.1909 0.5798 0.7942 0.9901 0.7446 0.6072 0.6831 0.3676 0.6992 0.8656 0.8439 0.7604 0.0592 0.7889 0.2679 0.6299 0.0928 0.6315 0.7275 0.2324 0.1739 0.5298 0.6029 0.4387 0.4399 0.3705 0.0353 0.7176 0.4784 0.8049 0.1708 0.6405 0.0503 0.4983 0.9334 0.5751 0.6124 0.6927 0.5548 0.9084 0.9943 >> F1 = f_vp(A,'cos') F1 = Columns 1 through 6 1.0064 - 0.0000i -0.1900 - 0.0000i -0.1545 + 0.0000i -0.0108 + 0.0000i 0.1287 + 0.0000i -0.0837 + 0.0000i -0.0675 + 0.0000i 0.8365 + 0.0000i -0.0932 - 0.0000i -0.0714 + 0.0000i -0.0346 - 0.0000i 0.0288 - 0.0000i -0.0797 + 0.0000i -0.0674 - 0.0000i 0.8446 - 0.0000i -0.1407 - 0.0000i 0.0847 + 0.0000i -0.0468 -0.0531 + 0.0000i -0.0048 - 0.0000i 0.0970 - 0.0000i 0.9299 - 0.0000i -0.1757 + 0.0000i -0.0932 - 0.0000i -0.0881 - 0.0000i -0.2460 - 0.0000i -0.0222 + 0.0000i -0.1356 - 0.0000i 1.0071 + 0.0000i 0.0576 - 0.0000i -0.1567 + 0.0000i 0.0325 + 0.0000i 0.0486 - 0.0000i -0.1448 + 0.0000i -0.0228 - 0.0000i 0.9764 + 0.0000i -0.1073 - 0.0000i 0.0292 - 0.0000i -0.0001 - 0.0000i 0.0774 - 0.0000i -0.0591 + 0.0000i -0.0384 + 0.0000i -0.1127 - 0.0000i -0.0600 - 0.0000i -0.0993 - 0.0000i -0.0217 - 0.0000i -0.0592 + 0.0000i -0.1313 + 0.0000i 0.0646 - 0.0000i -0.1080 - 0.0000i -0.1870 - 0.0000i -0.0032 - 0.0000i -0.0390 + 0.0000i -0.0950 + 0.0000i -0.0297 - 0.0000i 0.0645 + 0.0000i -0.0174 - 0.0000i -0.1681 + 0.0000i -0.2286 - 0.0000i -0.1916 - 0.0000i Columns 7 through 10 -0.0129 - 0.0000i -0.1541 + 0.0000i -0.0458 + 0.0000i -0.1537 - 0.0000i -0.0198 + 0.0000i -0.0497 - 0.0000i 0.0128 + 0.0000i -0.0810 - 0.0000i -0.1012 - 0.0000i -0.0116 + 0.0000i -0.1177 - 0.0000i -0.0086 + 0.0000i -0.1025 - 0.0000i -0.0179 - 0.0000i -0.0690 - 0.0000i -0.0094 + 0.0000i -0.0494 - 0.0000i
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 11/05/2011 for the course AUTOMATIC 18 taught by Professor Corneliupopeea during the Spring '11 term at UPB Colombia.

Page1 / 6

tema_cna_3_Cosma - Cosma Mihai gr 331AA Tema laborator 3 1...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online