www.gusucode.com > mbc 工具箱 matlab 源码程序 > mbc/@mbcfoundation/@gridDefinition/getPositions.m
function el_pos = getPositions(obj, pos) %GETPOSITIONS Get cell array of grid positions % % GRID_POS = GETPOSITIONS(OBJ, POS) creates a (numels-by-1) vector of % positions for the cells in the grid defined by OBJ. POS is a standard % position rectangle defining the location and size that the entire grid % should be. % Copyright 2000-2004 The MathWorks, Inc. and Ford Global Technologies, Inc. if isempty(obj.RowRatios) RR = ones(1, obj.Rows)./obj.Rows; else RR = obj.RowRatios; end if isempty(obj.ColumnRatios) CR = ones(1, obj.Columns)./obj.Columns; else CR = obj.ColumnRatios; end el_pos = obj.pCalcPositions(pos, ... obj.Rows, ... obj.Columns, ... obj.RowSizes, ... obj.ColumnSizes, ... RR, ... CR, ... obj.RowGap, ... obj.ColumnGap, ... obj.DoMerge, ... obj.MergeNRows, ... obj.MergeNCols);