No BSD License  

Highlights from
subplotrc

5.0

5.0 | 1 rating Rate this file 1 Download (last 30 days) File Size: 464 Bytes File ID: #11272

subplotrc

by Andrew Diamond

 

02 Jun 2006 (Updated 02 Jun 2006)

extension of subplot, subplotrc(m,n,r,c) put suplot in row r, column c of figure.

| Watch this File

File Information
Description

A totally trivial function that I keep on rewriting in line over and over again. Must be somewhere I'm missing or I'm missing something. Here it is in it's "glorious" entirety (-;
---------
function h=subplotrc(varargin)
% function h=subplotrc(varargin) - extension of subplot
% subplotrc(m,n,r,c) put suplot in row r, column c of figure;
% all other forms passed through to subplot without alteration
if(length(varargin)==4 && all(cellfun(@isnumeric,varargin)))
    p=sub2ind([varargin{2},varargin{1}],varargin{4},varargin{3});
    h=subplot(varargin{1},varargin{2},p);
else
    h=subplot(varargin{:})
end
if(nargout == 0)
    clear h;
end

MATLAB release MATLAB 7.1.0 (R14SP3)
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (2)
03 Dec 2008 Arturo Serrano  
05 Apr 2010 Abba

Nice, thanks for pointing out the sub2ind function

Please login to add a comment or rating.
Tag Activity for this File
Tag Applied By Date/Time
annotation Andrew Diamond 22 Oct 2008 08:27:37
customization Andrew Diamond 22 Oct 2008 08:27:37
subplot Andrew Diamond 22 Oct 2008 08:27:37
row Andrew Diamond 22 Oct 2008 08:27:37
column Andrew Diamond 22 Oct 2008 08:27:37
graphics Andrew Diamond 22 Oct 2008 08:27:37

Contact us at files@mathworks.com