You are on page 1of 6

function varargout = interfaz(varargin)

% INTERFAZ MATLAB code for interfaz.fig


% INTERFAZ, by itself, creates a new INTERFAZ or raises the existing
% singleton*.
%
% H = INTERFAZ returns the handle to a new INTERFAZ or the handle to
% the existing singleton*.
%
% INTERFAZ('CALLBACK',hObject,eventData,handles,...) calls the local
% function named CALLBACK in INTERFAZ.M with the given input arguments.
%
% INTERFAZ('Property','Value',...) creates a new INTERFAZ or raises the
% existing singleton*. Starting from the left, property value pairs are
% applied to the GUI before interfaz_OpeningFcn gets called. An
% unrecognized property name or invalid value makes property application
% stop. All inputs are passed to interfaz_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 interfaz

% Last Modified by GUIDE v2.5 09-Oct-2020 07:32:15

% Begin initialization code - DO NOT EDIT


gui_Singleton = 1;
gui_State = struct('gui_Name', mfilename, ...
'gui_Singleton', gui_Singleton, ...
'gui_OpeningFcn', @interfaz_OpeningFcn, ...
'gui_OutputFcn', @interfaz_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 interfaz is made visible.


function interfaz_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 interfaz (see VARARGIN)

% Choose default command line output for interfaz


handles.output = hObject;
% Update handles structure
guidata(hObject, handles);

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


% uiwait(handles.figure1);

% --- Outputs from this function are returned to the command line.
function varargout = interfaz_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)
imagen=imread('armadura.jpeg');
image(imagen,'Parent',handles.axes4);
set(handles.axes4,'XTick',[],'YTick',[]);
box on;
grip on;
handles.output = hObject;
%Update handles structure
guidata(hObject,handles);
% Get default command line output from handles structure
varargout{1} = handles.output;

% --- Executes on button press in b1.


function b1_Callback(hObject, eventdata, handles)
axes(handles.axes3);
% barra 1
x=linspace(0,3,100)
y=linspace(0,3,100)
plot(x,y,'r')
plot(x,y,'k')
hold on

% barra 2
x=linspace(3,6,100)
y=linspace(3,3,100)
plot(x,y,'r')
plot(x,y,'k')
hold on

% barra 3
x=linspace(6,9,100)
y=linspace(3,3,100)
plot(x,y,'r')
plot(x,y,'k')
hold on

% barra 4
x=linspace(9,12,100)
y=linspace(3,3,100)
plot(x,y,'r')
plot(x,y,'k')
hold on
% barra 5
x=linspace(12,9,100)
y=linspace(3,0,100)
plot(x,y,'r')
plot(x,y,'k')
hold on

% barra 6
x=linspace(9,6,100)
y=linspace(0,0,100)
plot(x,y,'r')
plot(x,y,'k')
hold on

% barra 7
x=linspace(6,3,100)
y=linspace(0,0,100)
plot(x,y,'r')
plot(x,y,'k')
hold on

% barra 8
x=linspace(3,0,100)
y=linspace(0,0,100)
plot(x,y,'r')
plot(x,y,'k')
hold on

% barra 9
x=linspace(9,9,100)
y=linspace(0,3,100)
plot(x,y,'r')
plot(x,y,'k')
hold on

% barra 10
x=linspace(9,6,100)
y=linspace(3,0,100)
plot(x,y,'r')
plot(x,y,'k')
hold on

% barra 11
x=linspace(6,6,100)
y=linspace(0,3,100)
plot(x,y,'r')
plot(x,y,'k')
hold on

% barra 12
x=linspace(6,3,100)
y=linspace(3,0,100)
plot(x,y,'r')
plot(x,y,'k')
hold on

% barra 13
x=linspace(3,3,100)
y=linspace(0,3,100)
plot(x,y,'r')
plot(x,y,'k')
hold on

axis([-2 14 -2 5])

% hObject handle to b1 (see GCBO)


% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)

% --- Executes on selection change in popupmenu1.


function popupmenu1_Callback(hObject, eventdata, handles)
% hObject handle to popupmenu1 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% datos2=get(handles.ta,'data',X2)
% set(handles.ta,'data',datos2(:,3));

% Hints: contents = cellstr(get(hObject,'String')) returns popupmenu1 contents


as cell array
% contents{get(hObject,'Value')} returns selected item from popupmenu1

% --- Executes during object creation, after setting all properties.


function popupmenu1_CreateFcn(hObject, eventdata, handles)
% hObject handle to popupmenu1 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns called

% Hint: popupmenu controls usually have a white background on Windows.


% See ISPC and COMPUTER.
if ispc && isequal(get(hObject,'BackgroundColor'),
get(0,'defaultUicontrolBackgroundColor'))
set(hObject,'BackgroundColor','white');
end

% --- Executes during object creation, after setting all properties.


function axes4_CreateFcn(hObject, eventdata, handles)
% hObject handle to axes4 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns called

% Hint: place code in OpeningFcn to populate axes4

function popupmenu2_Callback(hObject, eventdata, handles)

contenido=get(hObject,'string');
a=get(hObject,'value');
tipo=contenido(a);
Q1=str2double(get(handles.Q1,'string'));
Q2=str2double(get(handles.Q2,'string'));

% V1 V2 H1 H2 F1 F2 F3 F4 F5 F6
A=[0 0 1 0 -cos(pi/4) 0 0 0 0 0;...
1 0 0 0 -sin(pi/4) 0 0 0 0 0;...
0 0 0 0 sin(pi/4) -cos(44.76*pi/180) 0 -sin(67.38*pi/180) 0 0;...
0 0 0 0 cos(pi/4) sin(44.76*pi/180) 0 -cos(67.38*pi/180) 0 0;...
0 0 0 -1 0 cos(22.38*pi/180) cos(pi/4) 0 0 0;...
0 1 0 0 0 -sin(22.38*pi/180) -sin(pi/4) 0 0 0;...
0 0 0 0 0 0 -sin(pi/4) cos(22.62*pi/180) cos(67.38*pi/180) 0;...
0 0 0 0 0 0 cos(pi/4) sin(22.62*pi/180) -sin(67.38*pi/180) 0;...
0 0 0 0 0 0 0 0 -sin(22.62*pi/180) 0;...
0 0 0 0 0 0 0 0 cos(22.62*pi/180) 1];

B=[0 ;0 ;Q1 ;0 ;0 ;0 ;0 ;0 ;Q2 ;0];

switch cell2mat(tipo)

case 'ELIMINACIÓN DE GAUSS'


AB=[A B];
x0=rref(AB);
X0=x0(:,11);

set(handles.ta,'data',X0);

case 'MATRIZ INVERSA'


X1=inv(A)*B;
set(handles.ta1,'data',X1);
% datos1=get(handles.ta,'data',X1)
% set(handles.ta1,'data',datos1(:,2));

case 'DESCOMPOSICIÓN LU'


[L U]=lu(A);
D=inv(L)*B;
X2=inv(U)*D;
set(handles.ta2,'data',X2);
% datos2=get(handles.ta,'data',X2)
% set(handles.ta,'data',datos2(:,3));
end

1.0000 0 0 -0.7071 0 0 0 0 0 0 0 0 0 0 0 0

0 0 0 -0.7071 0 0 0 0 0 0 1.0000 0 0 0 0
0

0 0 0 0.7071 0 0 0 0 0 0 0 0 0 0 0
-1.0000

0 0 0 0.7071 1.0000 0 0 0 0 0 0 0 0 0 0
0
0 0 0 0 0 0 0 0 0 0 0 0 0 1.0000 -0.7071
0

0 0 0 0 1.0000 -1.0000 0 0 0 0 0 0 0 0 0.7071


0

0 0 0 0 0 1.0000 -1.0000 0 0 0 0 0 0.7071 0 0


0

0 0 0 0 0 0 0 0 0 0 0 -1.0000 0.7071 0 0
0

0 0 -1.0000 0 0 0 1.0000 -0.7071 0 0 0 0 0 0 0


0

0 1.0000 0 0 0 0 0 -0.7071 0 0 0 0 0 0 0
0

0 0 0 0 0 0 0 -0.7071 1.0000 0 0 0 0 0 0
0

0 0 0 0 0 0 0 0.7071 0 0 0 1.0000 0 0 0
0

0 0 0 0 0 0 0 0 0 0 0 0 -0.7071 1.0000 0
0

0 0 0 0 0 0 0 0 -1.0000 1.0000 0 0 0.7071 0 0


0

0 0 0 0 0 0 0 0 0 -1.0000 1.0000 0 0 0 -0.7071


0

0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.7071
1.0000

>

You might also like