function myplot(x, y, sym, ttl, xlab, ylab, grd, lgnd) % MYPLOT - Generic plot - compatibility wrapper for plot() % Octave version. See below for Matlab version. % In Octave, title and axis labels must be issued % BEFORE the plot() command. if nargin<8, lgnd=''; end if nargin<7, grd=1; end if nargin<6, ylab=''; end if nargin<5, xlab=''; end if nargin<4, ttl=''; end if nargin<3, sym='*k'; end if nargin<2, y=x; x=0:length(y)-1; end title(ttl); ylabel(ylab); xlabel(xlab); if grd, grid('on'); else grid('off'); end plot(x,y,sym); legend(lgnd); |
function myplot(x, y, sym, ttl, xlab, ylab, grd, lgnd) % MYPLOT - Generic plot - compatibility wrapper for plot() % Matlab version. Title and axis labels must be % placed AFTER the plot() command. if nargin<8, lgnd=''; end if nargin<7, grd=1; end if nargin<6, ylab=''; end if nargin<5, xlab=''; end if nargin<4, ttl=''; end if nargin<3, sym='*k'; end if nargin<2, y=x; x=0:length(y)-1; end plot(x,y,sym); title(ttl); ylabel(ylab); xlabel(xlab); if grd, grid('on'); end legend(lgnd); |