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: Controlmethod = 'Bilinear';switch lower(method)case {'linear','bilinear'}disp('Method is linear')case 'cubic'disp('Method is cubic')case 'nearest'disp('Method is nearest')otherwisedisp('Unknown method.')end% Precisión de la máquinaeps=1;while (1+eps)>1eps=eps/2;endeps=eps*2% Contar las líneas de código de magic.mfid=fopen('magic.m', 'r');count=0;while ~feof(fid)linea = fgetl(fid);if isempty(linea) | strncmp(linea,'%',1)continueendcount=count+1;endfclose(fid);disp(sprintf('%d líneas', count));13

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

Saved successfully!

Ooh no, something went wrong!