• Sign Up
• Login
• API
• FAQ
• Tools
• Archive
SHARE
TWEET

# Untitled

a guest Feb 27th, 2020 70 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
1. clc;
2. clear all;
3. close all;
4. A=zeros(5,5)
5. for j=1:5
6.     for i=1:5
7.         if i>3
8.             A(i,j)=sin(pi/i)^2-0.94;
9.         else
10.             A(i,j)=((i-j)^2*0.983)^0.5;
11.         end
12.     end
13. end
14. A
15. K7=length(A(1,:))
16. SrZn=sum(A')'/K7
17. MIN=min(A)
18. MAX=max(A)
19. A1=A;
20. A1(:,[1 4])=A1(:,[4 1])
21. X=diag(A)
22. P = sort(X)
23. %% SLAU
24. A6 = [3 -1 0;-2 1 1;2 -1 4]
25. B=[5;0;15]
26. X=A6^-1*B
27. Z=A6*X
28.
29.
30. %%zadanie2 interpolyacia-approximacia
31. X=[0.324 0.645 0.966 1.287 1.609 1.930 2.251 2.572 2.893]
32. Y=[-2.052 -1.756 -1.076 -0.284 0.982 2.209 4.013 5.796 8.011]
33. plot(X,Y, '.r', 'MarkerSize', 20)
34. hold on
35. grid on
36. xx=X(1):0.1:X(end);
37. %%xx=X(1):0.1:2.924;
38. yy=spline(X,Y,xx);
39. figure(1)
40. plot(xx,yy)
41.
42.
43. %%zadanie3 MNK
44. X=[0.324 0.645 0.966 1.287 1.609 1.930 2.251 2.572 2.893]
45. Y=[-2.052 -1.756 -1.076 -0.284 0.982 2.209 4.013 5.796 8.011]
46.
47. figure(2)
48. plot(X,Y, '*r', 'MarkerSize', 10)
49. hold on
50. grid on
51. xxx=X(1):0.1:2.924;
52. p=polyfit(X,Y,2)
53. yyy=p(1)*xxx.*xxx+p(2)*xxx+p(3);
54. figure(2)
55. plot(xxx,yyy)
56.
57. %%zadanie4 integral
58. X=[0.324 0.645 0.966 1.287 1.609 1.930 2.251 2.572 2.893]
59. Y=[-2.052 -1.756 -1.076 -0.284 0.982 2.209 4.013 5.796 8.011]
60. Q=trapz(X,Y)
61. %%zadanie4 integral
62. Q1=quad('exp(-(X.^2)/2)',-2,2,1e-4)
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy.
Top