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:

Down with the Dictatorship!

    "Let them hate me, so that they fear me" - Caligula 41AD