Escolar Documentos
Profissional Documentos
Cultura Documentos
if nargout
[varargout{1:nargout}] = gui_mainfcn(gui_State, varargin{:});
else
gui_mainfcn(gui_State, varargin{:});
end
% End initialization code - DO NOT EDIT
axes(handles.axes1); cla;
grid on; box on;
clc
% UIWAIT makes Area_entre_curvas wait for user response (see UIRESUME)
% uiwait(handles.figure1);
% --- Outputs from this function are returned to the command line.
function varargout = Area_entre_curvas_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;
fx = sym(get(handles.fx, 'String'));
gx = sym(get(handles.gx, 'String'));
a = str2num(get(handles.a, 'String'));
b = str2num(get(handles.b, 'String'));
S = abs(eval(int((fx-gx), a, b)));
set(handles.sol, 'String', S);
cla
vx = linspace(a, b, 1000);
plot(vx, subs(fx, vx), 'Linewidth', 2);
hold on; grid on;
plot(vx, subs(gx, vx), 'r', 'Linewidth', 2);
legend('f(x)', 'g(x)');
axes(handles.axes1); cla;