Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 5. Command Window:
- A=rand(10,10)
- Script:
- sum = 0;
- for i=1:1:10
- for j=1:1:10
- if A(i,j)>0.5
- sum=sum+A(i,j);
- end
- end
- end
- disp(sum)
- 6. Function:
- function [ x ] = obrat( x )
- j=length(x);
- p=fix(length(x)/2);
- for i=1:p
- t=x(i);
- x(i)=x(j);
- x(j)=t;
- j=j-1;
- end
Add Comment
Please, Sign In to add comment