www.gusucode.com > matlab 案例源码 matlab代码程序 > matlab/GetIndexNumberofTileContainingLastPixelExample.m

    %% Get Index Number of Tile Containing Last Pixel  

%% 
% Open a |Tiff| object and get the dimensions of the image to calculate
% coordinates. 
t = Tiff('example.tif','r');
numRows = getTag(t,'ImageLength');
numCols = getTag(t,'ImageWidth');  

%% 
% Get the ID number of the tile containing the coordinates. 
tileNum = computeTile(t,[numRows numCols])  

%% 
% Close the |Tiff| object. 
close(t)