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);
- tic
- indeces=find(x>0);
- positive=x(indeces);
- if(s(1) ==1 || s(2)==1)
- disp('positives index location');
- fprintf(' %d %d\n',[positive;indeces]);
- disp('positives element num location');
- fprintf(' %d %d\n',[positive;indeces]');
- end
- toc
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement