Advertisement
Guest User

Untitled

a guest
Apr 20th, 2017
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Scilab 0.74 KB | None | 0 0
  1. //Zadanie 2, grupa A - METODA OBSZARÓW KOLOKACJI
  2.  
  3. clear
  4.  
  5. figure
  6.  
  7. n11=integrate ('1-x' , 'x' , 0, 1/3)
  8. n12=integrate ('2*x-x^2' , 'x' , 0 ,1/3)
  9. n13=integrate ('-x^3+3*x^2' , 'x' , 0 ,1/3)
  10.  
  11. n21=integrate ('1-x' , 'x' , 1/3, 2/3)
  12. n22=integrate ('2*x-x^2' , 'x' , 1/3, 2/3)
  13. n23=integrate ('-x^3+3*x^2' , 'x' , 1/3, 2/3)
  14.  
  15. n31=integrate ('1-x' , 'x' , 2/3, 1)
  16. n32=integrate ('2*x-x^2' , 'x' , 2/3, 1)
  17. n33=integrate ('-x^3+3*x^2' , 'x' , 2/3, 1)
  18.  
  19.  
  20. q1=integrate ('x-1.5' , 'x' , 0 , 1/3)
  21. q2=integrate ('x-1.5' , 'x' , 1/3 , 2/3)
  22. q3=integrate ('x-1.5' , 'x' , 2/3 , 1)
  23.  
  24. A3=[n11 , n12, n13 ; n21 , n22 , n23 ; n31 , n32 , n33]
  25. b3=[q1;q2;q3]
  26. t3=linsolve (A3,b3)
  27.  
  28. x=0:0.1:1
  29.     y3=1.5+t3(1,1)*x+t3(2,1)*x^2+t3(3,1)*x^3
  30. plot (x,y3,'.-g')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement