12.07.2015 Views

MATLAB

MATLAB

MATLAB

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Programación: Funcionesfunction varargout=atan3(varargin)if nargin==1rad=atan(varargin{1});elseif nargin==2rad=atan2(varargin{1},varargin{2});elsedisp('Error: más de dos argumentos')returnendvarargout{1}=rad;varargout{2}=rad*180/pi;endfunction [x0, y0] = myplot(x, y, npts, angle, subdiv)% MYPLOT Plot a function.% MYPLOT(x, y, npts, angle, subdiv)% The first two input arguments are% required; the other three have default values....if nargin < 5, subdiv = 20; endif nargin < 4, angle = 10; endif nargin < 3, npts = 25; end...if nargout == 0plot(x, y)elsex0 = x;y0 = y;end16

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!