Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- row=30;
- c=1:10;
- E= fix(rand(row,length(c))*100);
- for i=1:length(c) //i used this loop to do an example..
- in(i)=fix(abs(rand(1)*10));
- if !in(i)
- in(i)=1;
- endif
- endfor
- I want to SPEED it the loop (for hh=1:length(in) , for gg=in(hh):row )
- for hh=1:length(in)
- maxRel=-999999999999999999;
- minRel=9999999999999999999;
- rangeRel=0;
- for gg=in(hh):row
- v1=E(gg,hh)>maxRel;
- maxRel=max(E(gg,hh),maxRel);
- minRel=!v1*minRel+v1*9999999999999999999999;
- minRel=min(E(gg,hh),minRel);
- diff=maxRel-minRel;
- rangeRel=max(diff,rangeRel);
- endfor
- Range(hh)=rangeRel;
- endfor
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement