⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 fillrect_ulwh.m

📁 quadtree implementation in matlab
💻 M
字号:
% % fill the rectangle region specified by upper left corner width
% % and height of recangle.

% % INPUT
% % ul=[x0,y0] i.e coordinates of upper left corner of rectangle
% % w: width of rectangle
% % h: height of rectangle
% % colorStr: color string one of eight predefined colors 
% %           'r' or 'y' or 'g' or 'c' or 'b' or 'm' or 'w' or 'b'
function fillrect_ulwh(ul,w,h,varargin)

% % % Default Values 
colorStr='g'; %default filling color green
defaultValues = {colorStr};
% % % Assign Values
nonemptyIdx = ~cellfun('isempty',varargin);
defaultValues(nonemptyIdx) = varargin(nonemptyIdx);
[colorStr] = deal(defaultValues{:});
% % %---------------------

% fill([ ul(1)+w, ul(1)+w, ul(1), ul(1) ],...
%      [ ul(2)+h, ul(2)+h, ul(2), ul(2) ],...
%        colorStr);

% figure, ,hold on
% axis ij
fill([ ul(1), ul(1),   ul(1)+w, ul(1)+w ],...
     [ ul(2), ul(2)+h, ul(2)+h, ul(2) ],...
       colorStr);
axis ij

% figure,
% axis normal

% % -------------------------------------------------------------------------
% % This program or any other program(s) supplied with it does not provide any
% % warranty direct or implied. This program is free to use/share for
% % non-commercial purpose only, for any other usage contact with author.
% % Kindly reference author.
% % Thanking you.
% % @ Copyright M Khan
% % Email: mak2000sw@yahoo.com
% %        mak2000@GameBox.net 
% % http://www.geocities.com/mak2000sw

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -