Advertisement
Guest User

Untitled

a guest
Oct 21st, 2019
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.41 KB | None | 0 0
  1.  
  2.  
  3. % musis vytvorit funkci ktera ti vrati to S
  4. % koukni se na https://www.youtube.com/watch?v=o8gqf9cyfpI mozna ti to
  5. % pomuze
  6.  
  7. %vysledek = jmenoTvojiFunkce(x, y)
  8. % kde x a y jsou vstupy pro funkci
  9.  
  10.  
  11. close;clear;clc;
  12.  
  13. %vstup:
  14. vstup_x = 0:0.01:10;
  15. vstup_y = abs(sin(vstup_x));
  16.  
  17. plot(vstup_x, vstup_y);
  18.  
  19.  
  20. S=0;
  21. for i=1:length(vstup_x)-1
  22. S = S + vstup_y(i)*(vstup_x(i+1)-vstup_x(i));
  23. end
  24.  
  25. disp(S);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement