Rank: 282 based on 205 downloads (last 30 days) and 5 files submitted
photo

Steve Hoelzer

E-mail

Personal Profile:
Professional Interests:

 

Watch this Author's files

 

Files Posted by Steve View all
Updated   File Tags Downloads
(last 30 days)
Comments Rating
31 Mar 2011 Screenshot Annoy-a-tron Annoy and confound fellow MATLAB users. Author: Steve Hoelzer fun, prank 2 0
08 Oct 2010 Screenshot progressbar Simple, efficient, and user friendly replacement for waitbar. Author: Steve Hoelzer gui tools, progress bar, progress, progressbar, waitbar, wait 151 42
  • 4.89189
4.9 | 41 ratings
13 May 2009 Published MATLAB Files Droste Effect Tool Apply the Droste Effect to an image using a GUI or function call. Author: Steve Hoelzer droste, conformal mapping, special effects, demo, gui, image processing 18 1
  • 5.0
5.0 | 1 rating
25 Mar 2009 Screenshot figuresc Create a figure scaled relative to screen size. It's an easy way to make non-default size figures. Author: Steve Hoelzer gui tools, figure, plot 1 1
  • 5.0
5.0 | 1 rating
25 Mar 2009 Screenshot subfigure Create a figure within a grid-based layout. Like subplot, but for figures. Author: Steve Hoelzer subplot, figure, gui tools, subfigure, plot, graphics 33 4
  • 4.25
4.2 | 4 ratings
Comments and Ratings by Steve View all
Updated File Comments Rating
06 Oct 2011 progressbar Simple, efficient, and user friendly replacement for waitbar. Author: Steve Hoelzer

Matthew: Thanks! As for label updates, I'm still waiting for a patch. ;)

14 Jun 2011 progressbar Simple, efficient, and user friendly replacement for waitbar. Author: Steve Hoelzer

Gianluca: Thanks for the comments!

I'm not familiar with MATLAB's parallel computing features, so I don't know for sure what's going on. My guess is that you can't update local figures from "workers", so you need to monitor their status somehow and update progressbar locally. Let me know if you figure out how to make it work.

26 May 2011 progressbar Simple, efficient, and user friendly replacement for waitbar. Author: Steve Hoelzer

Daniel: Those sound like interesting features. I'd like see how you did it, so please send your code my way. Thanks!

16 May 2011 progressbar Simple, efficient, and user friendly replacement for waitbar. Author: Steve Hoelzer

Halil: There is no way to update labels without resetting the whole progress bar. I'd welcome code to implement that feature... :)

You're right about the remaining time calculation. I did it that way because of my concept of what multiple bars represent. I always think of the top bar as progress of the overall task, and other bars as progress of sub tasks. For an example of how I would use it, look at the "Fancy multi bar" demo in the progressbar's comments.

12 Apr 2011 progressbar Simple, efficient, and user friendly replacement for waitbar. Author: Steve Hoelzer

Ayla: It will take a little work to put progressbar in your own GUI. You'll have to change how the bar is created so it draws in the right place in your GUI instead of its own figure. Good luck!

Comments and Ratings on Steve's Files View all
Updated File Comment by Comments Rating
31 Jan 2012 progressbar Simple, efficient, and user friendly replacement for waitbar. Author: Steve Hoelzer Dmitry
27 Jan 2012 subfigure Create a figure within a grid-based layout. Like subplot, but for figures. Author: Steve Hoelzer Farrahi Moghaddam, Reza

Very good function!

Here is a small modification to enable the user to choose the screen in case he has multiple screens (like dual screens). The fourth parameter, screen_number, is the number of the screen to be used. If it is 0, both screens will be used. The default value of 1 (the main screen).

-----------------------------------
function varargout = subfigure(varargin)
% Create a figure within a grid-based layout. It's subplot for figures.
%
% subfigure(m,n,p), or subfigure(mnp), divides the screen into an m-by-n grid of
% tiles and creates a figure within the pth tile. Tiles are counted along the
% top row of the screen, then the second row, etc.
%
% If p is a vector, the figure is sized to cover all the subfigure positions
% listed in p.
%
% subfigure(m,n) creates a figure showing a m-by-n grid layout with tiles
% labeled in the order that they are numbered by subfigure. This is useful for
% planning screen layouts, especially when one or more subfigures will span
% multiple tiles (when p is a vector).
%
% h = subfigure(...) returns a handle to the figure.
%
% Every call to subfigure creates a new figure even if a figure exists at the
% location specified by m, n, and p. The existing figure is not made current or
% reused. Existing figures that are overlapped by new subfigures are not
% deleted. This behavior is dissimilar to subplot.
%
% Example 1: Four non-overlapping figures.
%
% subfigure(2,2,1)
% subfigure(2,2,2)
% subfigure(2,2,3)
% subfigure(2,2,4)
%
% Example 2: Three non-overlapping figures of various sizes.
%
% subfigure(4,4,[1 13])
% subfigure(4,4,[2 4])
% subfigure(4,4,[6 16])
%
% Example 3: Show the grid for a 3 x 5 layout.
%
% subfigure(3,5)

% by Steve Hoelzer
% 2009-03-25
% Screen_number added by Reza Farrahi Moghaddam
% 2012-01-27

% Padding to allow room for figure borders and menus
hpad = 20;
vpad = 90;

% Process input arguments
switch nargin
    case 0
        error('Not enough input arguments.')
    case 1
        m = floor(varargin{1}/100);
        n = rem(floor(varargin{1}/10),10);
        p = rem(varargin{1},10);
screen_number = 1;
    case 2
        m = varargin{1};
        n = varargin{2};
        p = [];
screen_number = 1;
    case 3
        m = varargin{1};
        n = varargin{2};
        p = varargin{3};
screen_number = 1;
case 4
        m = varargin{1};
        n = varargin{2};
        p = varargin{3};
screen_number = varargin{4};
    otherwise
        error('Too many input arguments.')
end

% Error checking
if ~isscalar(m) || ~isscalar(n)
    error('Gird dimensions must be scalar values.')
end
if m < 0 || n < 0
    error('Grid dimensions must be greator than zero.')
end
if any(p > m*n)
    error('Position value exceeds grid size.')
end

if isempty(p)
    % Draw example grid using subplots
    p = m*n;
    f = figure('NumberTitle','Off',...
        'Name',sprintf('Subfigure tile numbering for a %i by %i grid',m,n));
    for i = 1:p
        h = subplot(m,n,i);
        set(h,'Box','On',...
            'XTick',[],...
            'YTick',[],...
            'XTickLabel',[],...
            'YTickLabel',[])
        text(0.5,0.5,int2str(i),...
            'FontSize',16,...
            'HorizontalAlignment','Center')
    end
    % Return handle if needed
    if nargout
        varargout{1} = f;
    end
    return
end

% Calculate tile size and spacing
scrsz = get(0, 'monitorpositions'); % 'ScreenSize');
switch screen_number
case 0
scrsz = [scrsz(1, 1:2), scrsz(end, 3:4)];
case 1
scrsz = scrsz(1, :);
case 2
scrsz = scrsz(2, :);
otherwise
scrsz = scrsz(1, :);
end
hstep = floor( (scrsz(3) - scrsz(1) + 1 - hpad) / n );
vstep = floor( (scrsz(4) - scrsz(2) + 1 - vpad) / m );
vsz = vstep - vpad;
hsz = hstep - hpad;

% Row and column positions of each subfigure in p
r = ceil(p/n);
c = rem(p,n);
c(c==0) = n; % Special case

% Position of each subfigure in p in pixels (left, right, bottom, top)
le = scrsz(1) - 1 + hpad + (c-1)*hstep;
ri = le + hsz;
bo = scrsz(2) - 1 + vpad + (m-r)*vstep;
to = bo + vsz;

% Position of a subfigure that covers all subfigures in p
le = min(le); % Leftmost left
ri = max(ri); % Rightmost right
bo = min(bo); % Lowest bottom
to = max(to); % Highest top

% Calculate figure position
pos = [le, bo, ri-le, to-bo]; % [left, bottom, width, height]

% Display figure
h = figure('Position',pos);

% Return handle if needed
if nargout
    varargout{1} = h;
end
-------------------------------

11 Jan 2012 progressbar Simple, efficient, and user friendly replacement for waitbar. Author: Steve Hoelzer Zach
07 Dec 2011 progressbar Simple, efficient, and user friendly replacement for waitbar. Author: Steve Hoelzer Ansary, Hamid.R
15 Nov 2011 progressbar Simple, efficient, and user friendly replacement for waitbar. Author: Steve Hoelzer Y.S.
Top Tags Applied by Steve
vis2009, gui tools, example, figure, graphics
Files Tagged by Steve View all
Updated   File Tags Downloads
(last 30 days)
Comments Rating
31 Mar 2011 Screenshot Annoy-a-tron Annoy and confound fellow MATLAB users. Author: Steve Hoelzer fun, prank 2 0
08 Oct 2010 Screenshot progressbar Simple, efficient, and user friendly replacement for waitbar. Author: Steve Hoelzer gui tools, progress bar, progress, progressbar, waitbar, wait 151 42
  • 4.89189
4.9 | 41 ratings
13 May 2009 Published MATLAB Files Droste Effect Tool Apply the Droste Effect to an image using a GUI or function call. Author: Steve Hoelzer droste, conformal mapping, special effects, demo, gui, image processing 18 1
  • 5.0
5.0 | 1 rating
08 Apr 2009 Published MATLAB Files Finding the Similar Entries: A Quantitative Approach based on CPU Runtime Behavior Entry to Matlab contest Spring 2009 Author: C Jethro Lam vis2009 2 7
  • 3.8
3.8 | 5 ratings
08 Apr 2009 Published MATLAB Files LINEAGE v1.1 LINEAGE helps visualize the evolution of the code throughout the Peg Solitaire contest Author: Kenneth Eaton vis2009 1 7
  • 4.0
4.0 | 1 rating

Contact us at files@mathworks.com