You are on page 1of 3

function varargout = Carrito(varargin)

% CARRITO M-file for Carrito.fig


%
CARRITO, by itself, creates a new CARRITO or raises the existing
%
singleton*.
%
%
H = CARRITO returns the handle to a new CARRITO or the handle to
%
the existing singleton*.
%
%
CARRITO('CALLBACK',hObject,eventData,handles,...) calls the local
%
function named CALLBACK in CARRITO.M with the given input arguments.
%
%
CARRITO('Property','Value',...) creates a new CARRITO or raises the
%
existing singleton*. Starting from the left, property value pairs are
%
applied to the GUI before Carrito_OpeningFunction gets called. An
%
unrecognized property name or invalid value makes property application
%
stop. All inputs are passed to Carrito_OpeningFcn via varargin.
%
%
*See GUI Options on GUIDE's Tools menu. Choose "GUI allows only one
%
instance to run (singleton)".
%
% See also: GUIDE, GUIDATA, GUIHANDLES
% Edit the above text to modify the response to help Carrito
% Last Modified by GUIDE v2.5 05-Nov-2014 18:32:50
% Begin initialization code - DO NOT EDIT
gui_Singleton = 1;
gui_State = struct('gui_Name',
mfilename, ...
'gui_Singleton', gui_Singleton, ...
'gui_OpeningFcn', @Carrito_OpeningFcn, ...
'gui_OutputFcn', @Carrito_OutputFcn, ...
'gui_LayoutFcn', [] , ...
'gui_Callback', []);
if nargin && ischar(varargin{1})
gui_State.gui_Callback = str2func(varargin{1});
end
if nargout
[varargout{1:nargout}] = gui_mainfcn(gui_State, varargin{:});
else
gui_mainfcn(gui_State, varargin{:});
end
% End initialization code - DO NOT EDIT
% --- Executes just before Carrito is made visible.
function Carrito_OpeningFcn(hObject, eventdata, handles, varargin)
% This function has no output args, see OutputFcn.
% hObject
handle to figure
% eventdata reserved - to be defined in a future version of MATLAB
% handles
structure with handles and user data (see GUIDATA)
% varargin command line arguments to Carrito (see VARARGIN)
% Choose default command line output for Carrito
handles.output = hObject;
% Update handles structure
guidata(hObject, handles);

% UIWAIT makes Carrito wait for user response (see UIRESUME)


% uiwait(handles.figure1);
% --- Outputs from this function are returned to the command line.
function varargout = Carrito_OutputFcn(hObject, eventdata, handles)
% varargout cell array for returning output args (see VARARGOUT);
% hObject
handle to figure
% eventdata reserved - to be defined in a future version of MATLAB
% handles
structure with handles and user data (see GUIDATA)
% Get default command line output from handles structure
varargout{1} = handles.output;
% --- Executes on button press in graficar.
function graficar_Callback(hObject, eventdata, handles)
x=[2:0.1:2.7];
y=-1.182*x.^3+7.091*x.^2-9.604*x+5.297;
xi=[2:0.05:2.7];
yis=interp1(x,y,xi,'spline');
plot(xi,yis,'-g');
hold on
x=[2.7:0.1:3.8];
y=0.8093*x.^3-9.038*x.^2+33.94*x-33.9;
xi=[2.7:0.05:3.8];
yis=interp1(x,y,xi,'spline');
plot(xi,yis,'-g');
x=[3.8:0.1:6];
y=-0.05788*x.^3+0.8486*x.^2-3.623*x+13.69;
xi=[3.8:0.05:6];
yis=interp1(x,y,xi,'spline');
plot(xi,yis,'-g');
x=[6:0.1:8];
y=0.0442*x.^3-0.9887*x.^2+7.401*x-8.359;
xi=[6:0.05:8];
yis=interp1(x,y,xi,'spline');
plot(xi,yis,'-g');
x=[8:0.1:10];
y=-0.04028*x.^3+1.039*x.^2-8.818*x+34.89;
xi=[8:0.05:10];
yis=interp1(x,y,xi,'spline');
plot(xi,yis,'-g');
x=[10:0.1:13];
y=0.07451*x.^3-2.405*x.^2+25.62*x-79.9;
xi=[10:0.05:13];
yis=interp1(x,y,xi,'spline');
plot(xi,yis,'-g');
x=[13:0.1:16];
y=-0.1113*x.^3+4.841*x.^2-68.58*x+328.3;
xi=[13:0.05:16];
yis=interp1(x,y,xi,'spline');
plot(xi,yis,'-g');
x=[16:0.1:18];
y=0.0963*x.^3-5.123*x.^2+90.84*x-522;
xi=[16:0.05:18];
yis=interp1(x,y,xi,'spline');
plot(xi,yis,'-g');
x=[18:0.1:21];
y=-0.01298*x.^3+0.7781*x.^2-15.37*x+115.3;

xi=[18:0.05:21];
yis=interp1(x,y,xi,'spline');
plot(xi,yis,'-g');
x=[21:0.1:25];
y=0.003325*x.^3-0.2493*x.^2+6.201*x-35.68;
xi=[21:0.05:25];
yis=interp1(x,y,xi,'spline');
plot(xi,yis,'-g');
x=[25:0.1:30];
y=-0.01092*x.^3+0.8193*x.^2-20.51*x+186.9;
xi=[25:0.05:30];
yis=interp1(x,y,xi,'spline');
plot(xi,yis,'-g');
x=[30:0.1:36];
y=0.009094*x.^3-0.9822*x.^2+33.53*x-353.5;
xi=[30:0.05:36];
yis=interp1(x,y,xi,'spline');
plot(xi,yis,'-g');
x=[2:0.1:3];
y=7-x;
xi=[2:0.05:3];
yis=interp1(x,y,xi,'spline');
plot(xi,yis,'-g');
x=[3:0.1:12];
y=2.969*x-0.1994*x.^2-3.113;
xi=[3:0.05:12];
yis=interp1(x,y,xi,'spline');
plot(xi,yis,'-g');
x=[12:0.1:36];
y=0.05*x+3.2;
xi=[12:0.05:36];
yis=interp1(x,y,xi,'spline');
plot(xi,yis,'-g');
title('Carrito verde')

You might also like