Courbe_Impliquee

Экзамен MATLAB

Jun 15th, 2019
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.34 KB | None | 0 0
  1. 5. Command Window:
  2. A=rand(10,10)
  3. Script:
  4. sum = 0;
  5. for i=1:1:10
  6. for j=1:1:10
  7. if A(i,j)>0.5
  8. sum=sum+A(i,j);
  9. end
  10. end
  11. end
  12. disp(sum)
  13. 6. Function:
  14. function [ x ] = obrat( x )
  15. j=length(x);
  16. p=fix(length(x)/2);
  17. for i=1:p
  18. t=x(i);
  19. x(i)=x(j);
  20. x(j)=t;
  21. j=j-1;
  22. end
Add Comment
Please, Sign In to add comment