Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- x=[5 3 -5 6 9 7 -2 -3 -4;-5 -3 5 6 9 7 -2 -3 4];
- s=size(x);
- disp('positive numbers location')
- tic
- for i=1:s(1)
- for j=1:s(2)
- if x(i,j)>0
- positive =x(i,j);
- fprintf(' %d (%d,%d)\n',[positive i j]');
- end
- end
- end
- disp('')
- toc
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement