Oct 3, 2013

Matlab useful tricks

  • Finding a number to particular value:
    • example: Here if we want to find ratio close to 0.7 then we will look for ar for   the current image to be close to 0.7.
                aspect_ratio = [0.5 0.7 1.0 1.25 1.5 1.75 2.0 2.25 2.5 3];           
                ar = imgBB.width/imgBB.height
                tmp = abs(aspect_ratio - ar); 
                [val, idx] = min(tmp);  

                if (idx == 2) then print .... found it.
  •  

No comments:

Carlo Cipolla's Laws of Stupidity

    "By creating a graph of Cipolla's two factors, we obtain four groups of people. Helpless people contribute to society but are...