Está en la página 1de 31

Tarea Académica 3

Análisis de armadura

Docente: Ingeniera Lizbeth Cuba

Materia: Introducción a los métodos computacionales

Estudiante: Nicolás Ramírez Ochoa

Código: 201721833

Sección: CX61

Fecha: 20 de mayo del 2019


Introducción

El análisis de estructuras es importante para el desarrollo de la ingeniería


civil. Con este podemos predecir el comportamiento de las estructuras, asimismo
cuidar los límites para construir con seguridad. En este caso, Matlab nos facilita el
estudio de la armadura, ya que con un diseño de código podemos modificar en qué
condiciones se encuentra la armadura. Además, el programa lo realiza en un
tiempo rápido y se adecua a nuestras necesidades. En este trabajo mostraremos
cómo funciona el código y cómo se elaboró.
Análisis de armadura

1. Primero realizaremos un código para colocar la imagen de mi armadura.

function InterfazVIGA_OpeningFcn(hObject, eventdata, handles,


varargin)

axes(handles.axes1)
imshow(imread('sistema.jpg'));
handles.output = hObject;

guidata(hObject, handles);
2. El botón de “Importar” trabajará los datos que hemos ingresado en nuestro código. De
esta manera procesaremos los datos y tendremos lo que nos pide en análisis. Mediante
el método de matrices y análisis de nodos he resuelto el problema.

function pushbutton1_Callback(hObject, eventdata, handles)


A=zeros(16);
A(1,1)=-1;
A(1,4)=1;
A(1,3)=sin(pi/4);
A(2,2)=-1;
A(2,3)=cos(pi/4);
A(3,4)=-1;
A(3,5)=sin(pi/4);
A(4,6)=1;
A(4,5)=cos(pi/4);
A(5,5)=-sin(pi/4);
A(5,7)=-1;
A(6,10)=1;
A(6,5)=-cos(pi/4);
A(7,7)=1;
A(7,8)=sin(pi/4);
A(7,3)=-sin(pi/4);
A(8,8)=cos(pi/4);
A(8,9)=1;
A(8,6)=-1;
A(8,3)=-cos(pi/4);
A(9,8)=-sin(pi/4);
A(9,11)=-sin(pi/4);
A(10,12)=1;
A(10,11)=cos(pi/4);
A(10,10)=-1;
A(10,8)=-cos(pi/4);
A(11,14)=-1;
A(11,13)=-sin(pi/4);
A(12,13)=cos(pi/4);
A(12,12)=-1;
A(13,11)=sin(pi/4);
A(13,14)=1;
A(14,15)=1;
A(14,9)=-1;
A(14,11)=-cos(pi/4);
A(15,13)=sin(pi/4);
A(15,16)=-1;
A(16,13)=-cos(pi/4);
A(16,15)=-1;
set(handles.uitable1,'data',A);

B=[0;0;0;0;0;0;0;0;2;0;0;-2;4;0;0;0];
set(handles.uitable2,'data',B);

X=inv(A)*B;
set(handles.uitable5,'data',X);

set(handles.edit1,'string',-X(1))
set(handles.edit2,'string',-X(2))
set(handles.edit4,'string',X(3))
set(handles.edit3,'string',X(4))
set(handles.edit6,'string',X(5))
set(handles.edit5,'string',X(6))
set(handles.edit7,'string',X(7))
set(handles.edit9,'string',X(8))
set(handles.edit10,'string',X(9))
set(handles.edit8,'string',X(10))
set(handles.edit11,'string',X(11))
set(handles.edit12,'string',X(12))
set(handles.edit14,'string',X(13))
set(handles.edit13,'string',X(14))
set(handles.edit15,'string',X(15))
set(handles.edit16,'string',-X(16))
La matriz “A” quedaría así

La matriz “B” quedaría así

La matriz de resultados “X” queda así


3. Este código será para crear un archivo en base a los resultados de mi análisis.

function pushbutton2_Callback(hObject, eventdata, handles)


c=get(handles.uitable5,'data');
n=size(c,1);
archivo=fopen('Resultados.txt','w');
for i=1:n
fprintf(archivo,'%s %s \n',c{i,:});
end
fclose(archivo);
4. El botón de “Resetear” es para quitar los datos y resultados.

function pushbutton3_Callback(hObject, eventdata, handles)

set(handles.uitable1,'data','');

set(handles.uitable2,'data','');

set(handles.uitable5,'data','');

set(handles.edit1,'string','')
set(handles.edit2,'string','')
set(handles.edit4,'string','')
set(handles.edit3,'string','')
set(handles.edit6,'string','')
set(handles.edit5,'string','')
set(handles.edit7,'string','')
set(handles.edit9,'string','')
set(handles.edit10,'string','')
set(handles.edit8,'string','')
set(handles.edit11,'string','')
set(handles.edit12,'string','')
set(handles.edit14,'string','')
set(handles.edit13,'string','')
set(handles.edit15,'string','')
set(handles.edit16,'string','')
5. El botón de “Salir” es para cerrar la interfaz.

function pushbutton4_Callback(hObject, eventdata, handles)


close(InterfazVIGA)
6. El botón de “Nuevos datos” es para leer las nuevas reacciones externas y en base a estos
calcular los nuevos resultados. En este caso se alteran las ecuaciones, sin embargo se
mantiene el código.

function pushbutton5_Callback(hObject, eventdata, handles)


A=zeros(16);
A(1,1)=-1;
A(1,4)=1;
A(1,3)=sin(pi/4);
A(2,2)=-1;
A(2,3)=cos(pi/4);
A(3,4)=-1;
A(3,5)=sin(pi/4);
A(4,6)=1;
A(4,5)=cos(pi/4);
A(5,5)=-sin(pi/4);
A(5,7)=-1;
A(6,10)=1;
A(6,5)=-cos(pi/4);
A(7,7)=1;
A(7,8)=sin(pi/4);
A(7,3)=-sin(pi/4);
A(8,8)=cos(pi/4);
A(8,9)=1;
A(8,6)=-1;
A(8,3)=-cos(pi/4);
A(9,8)=-sin(pi/4);
A(9,11)=-sin(pi/4);
A(10,12)=1;
A(10,11)=cos(pi/4);
A(10,10)=-1;
A(10,8)=-cos(pi/4);
A(11,14)=-1;
A(11,13)=-sin(pi/4);
A(12,13)=cos(pi/4);
A(12,12)=-1;
A(13,11)=sin(pi/4);
A(13,14)=1;
A(14,15)=1;
A(14,9)=-1;
A(14,11)=-cos(pi/4);
A(15,13)=sin(pi/4);
A(15,16)=-1;
A(16,13)=-cos(pi/4);
A(16,15)=-1;
set(handles.uitable1,'data',A);

E1=eval(get(handles.edit17,'string'));
E2=eval(get(handles.edit19,'string'));
E3=eval(get(handles.edit18,'string'));
B=[0;0;0;0;0;0;0;0;E1;0;0;-E3;E2;0;0;0];
set(handles.uitable2,'data',B);

X=inv(A)*B;
set(handles.uitable5,'data',X);

set(handles.edit1,'string',-X(1))
set(handles.edit2,'string',-X(2))
set(handles.edit4,'string',X(3))
set(handles.edit3,'string',X(4))
set(handles.edit6,'string',X(5))
set(handles.edit5,'string',X(6))
set(handles.edit7,'string',X(7))
set(handles.edit9,'string',X(8))
set(handles.edit10,'string',X(9))
set(handles.edit8,'string',X(10))
set(handles.edit11,'string',X(11))
set(handles.edit12,'string',X(12))
set(handles.edit14,'string',X(13))
set(handles.edit13,'string',X(14))
set(handles.edit15,'string',X(15))
set(handles.edit16,'string',-X(16))
CÓDIGO ENTERO
function varargout = InterfazVIGA(varargin)
gui_Singleton = 1;
gui_State = struct('gui_Name', mfilename, ...
'gui_Singleton', gui_Singleton, ...
'gui_OpeningFcn',
@InterfazVIGA_OpeningFcn, ...
'gui_OutputFcn',
@InterfazVIGA_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

function InterfazVIGA_OpeningFcn(hObject, eventdata,


handles, varargin)

axes(handles.axes1)
imshow(imread('sistema.jpg'));
handles.output = hObject;

guidata(hObject, handles);

function varargout = InterfazVIGA_OutputFcn(hObject,


eventdata, handles)

varargout{1} = handles.output;

% --- Executes on button press in radiobutton1.


function radiobutton1_Callback(hObject, eventdata, handles)
% hObject handle to radiobutton1 (see GCBO)
% eventdata reserved - to be defined in a future version
of MATLAB
% handles structure with handles and user data (see
GUIDATA)

% Hint: get(hObject,'Value') returns toggle state of


radiobutton1

function edit1_Callback(hObject, eventdata, handles)


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

% Hints: get(hObject,'String') returns contents of edit4 as


text
% str2double(get(hObject,'String')) returns contents
of edit4 as a double

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


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

% Hint: edit 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

function edit2_Callback(hObject, eventdata, handles)


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

% Hints: get(hObject,'String') returns contents of edit1 as


text
% str2double(get(hObject,'String')) returns contents
of edit1 as a double

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


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

% Hint: edit 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

function edit3_Callback(hObject, eventdata, handles)


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

% Hints: get(hObject,'String') returns contents of edit2 as


text
% str2double(get(hObject,'String')) returns contents
of edit2 as a double
% --- Executes during object creation, after setting all
properties.
function edit3_CreateFcn(hObject, eventdata, handles)
% hObject handle to edit2 (see GCBO)
% eventdata reserved - to be defined in a future version
of MATLAB
% handles empty - handles not created until after all
CreateFcns called

% Hint: edit 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

function edit4_Callback(hObject, eventdata, handles)


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

% Hints: get(hObject,'String') returns contents of edit3 as


text
% str2double(get(hObject,'String')) returns contents
of edit3 as a double

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


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

% Hint: edit 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

function edit5_Callback(hObject, eventdata, handles)


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

% Hints: get(hObject,'String') returns contents of edit3 as


text
% str2double(get(hObject,'String')) returns contents
of edit3 as a double

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


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

% Hint: edit 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

function edit6_Callback(hObject, eventdata, handles)


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

% Hints: get(hObject,'String') returns contents of edit4 as


text
% str2double(get(hObject,'String')) returns contents
of edit4 as a double

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


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

% Hint: edit 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

function edit7_Callback(hObject, eventdata, handles)


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

% Hints: get(hObject,'String') returns contents of edit2 as


text
% str2double(get(hObject,'String')) returns contents
of edit2 as a double

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


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

% Hint: edit 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

function edit8_Callback(hObject, eventdata, handles)


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

% Hints: get(hObject,'String') returns contents of edit1 as


text
% str2double(get(hObject,'String')) returns contents
of edit1 as a double

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


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

% Hint: edit 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

function edit9_Callback(hObject, eventdata, handles)


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

% Hints: get(hObject,'String') returns contents of edit1 as


text
% str2double(get(hObject,'String')) returns contents
of edit1 as a double

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


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

% Hint: edit 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

function edit10_Callback(hObject, eventdata, handles)


% hObject handle to edit2 (see GCBO)
% eventdata reserved - to be defined in a future version
of MATLAB
% handles structure with handles and user data (see
GUIDATA)
% Hints: get(hObject,'String') returns contents of edit2 as
text
% str2double(get(hObject,'String')) returns contents
of edit2 as a double

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


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

% Hint: edit 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

function edit11_Callback(hObject, eventdata, handles)


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

% Hints: get(hObject,'String') returns contents of edit2 as


text
% str2double(get(hObject,'String')) returns contents
of edit2 as a double

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


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

% Hint: edit 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

function edit12_Callback(hObject, eventdata, handles)


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

% Hints: get(hObject,'String') returns contents of edit1 as


text
% str2double(get(hObject,'String')) returns contents
of edit1 as a double

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


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

% Hint: edit 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
function edit13_Callback(hObject, eventdata, handles)
% hObject handle to edit1 (see GCBO)
% eventdata reserved - to be defined in a future version
of MATLAB
% handles structure with handles and user data (see
GUIDATA)

% Hints: get(hObject,'String') returns contents of edit1 as


text
% str2double(get(hObject,'String')) returns contents
of edit1 as a double

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


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

% Hint: edit 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

function edit14_Callback(hObject, eventdata, handles)


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

% Hints: get(hObject,'String') returns contents of edit2 as


text
% str2double(get(hObject,'String')) returns contents
of edit2 as a double
% --- Executes during object creation, after setting all
properties.
function edit14_CreateFcn(hObject, eventdata, handles)
% hObject handle to edit2 (see GCBO)
% eventdata reserved - to be defined in a future version
of MATLAB
% handles empty - handles not created until after all
CreateFcns called

% Hint: edit 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

function edit15_Callback(hObject, eventdata, handles)


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

% Hints: get(hObject,'String') returns contents of edit1 as


text
% str2double(get(hObject,'String')) returns contents
of edit1 as a double

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


properties.
function edit15_CreateFcn(hObject, eventdata, handles)
% hObject handle to edit1 (see GCBO)
% eventdata reserved - to be defined in a future version
of MATLAB
% handles empty - handles not created until after all
CreateFcns called
% Hint: edit 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

function edit16_Callback(hObject, eventdata, handles)


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

% Hints: get(hObject,'String') returns contents of edit16


as text
% str2double(get(hObject,'String')) returns contents
of edit16 as a double

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


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

% Hint: edit 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 on button press in pushbutton1.


function pushbutton1_Callback(hObject, eventdata, handles)
A=zeros(16);
A(1,1)=-1;
A(1,4)=1;
A(1,3)=sin(pi/4);
A(2,2)=-1;
A(2,3)=cos(pi/4);
A(3,4)=-1;
A(3,5)=sin(pi/4);
A(4,6)=1;
A(4,5)=cos(pi/4);
A(5,5)=-sin(pi/4);
A(5,7)=-1;
A(6,10)=1;
A(6,5)=-cos(pi/4);
A(7,7)=1;
A(7,8)=sin(pi/4);
A(7,3)=-sin(pi/4);
A(8,8)=cos(pi/4);
A(8,9)=1;
A(8,6)=-1;
A(8,3)=-cos(pi/4);
A(9,8)=-sin(pi/4);
A(9,11)=-sin(pi/4);
A(10,12)=1;
A(10,11)=cos(pi/4);
A(10,10)=-1;
A(10,8)=-cos(pi/4);
A(11,14)=-1;
A(11,13)=-sin(pi/4);
A(12,13)=cos(pi/4);
A(12,12)=-1;
A(13,11)=sin(pi/4);
A(13,14)=1;
A(14,15)=1;
A(14,9)=-1;
A(14,11)=-cos(pi/4);
A(15,13)=sin(pi/4);
A(15,16)=-1;
A(16,13)=-cos(pi/4);
A(16,15)=-1;
set(handles.uitable1,'data',A);

B=[0;0;0;0;0;0;0;0;2;0;0;-2;4;0;0;0];
set(handles.uitable2,'data',B);
X=inv(A)*B;
set(handles.uitable5,'data',X);

set(handles.edit1,'string',-X(1))
set(handles.edit2,'string',-X(2))
set(handles.edit4,'string',X(3))
set(handles.edit3,'string',X(4))
set(handles.edit6,'string',X(5))
set(handles.edit5,'string',X(6))
set(handles.edit7,'string',X(7))
set(handles.edit9,'string',X(8))
set(handles.edit10,'string',X(9))
set(handles.edit8,'string',X(10))
set(handles.edit11,'string',X(11))
set(handles.edit12,'string',X(12))
set(handles.edit14,'string',X(13))
set(handles.edit13,'string',X(14))
set(handles.edit15,'string',X(15))
set(handles.edit16,'string',-X(16))

% --- Executes on button press in pushbutton2.


function pushbutton2_Callback(hObject, eventdata, handles)
c=get(handles.uitable5,'data');
n=size(c,1);
archivo=fopen('Resultados.txt','w');
for i=1:n
fprintf(archivo,'%s %s \n',c{i,:});
end
fclose(archivo);

% --- Executes on button press in pushbutton3.


function pushbutton3_Callback(hObject, eventdata, handles)

set(handles.uitable1,'data','');

set(handles.uitable2,'data','');

set(handles.uitable5,'data','');
set(handles.edit1,'string','')
set(handles.edit2,'string','')
set(handles.edit4,'string','')
set(handles.edit3,'string','')
set(handles.edit6,'string','')
set(handles.edit5,'string','')
set(handles.edit7,'string','')
set(handles.edit9,'string','')
set(handles.edit10,'string','')
set(handles.edit8,'string','')
set(handles.edit11,'string','')
set(handles.edit12,'string','')
set(handles.edit14,'string','')
set(handles.edit13,'string','')
set(handles.edit15,'string','')
set(handles.edit16,'string','')

% --- Executes on button press in pushbutton4.


function pushbutton4_Callback(hObject, eventdata, handles)
close(InterfazVIGA)

% --- Executes on button press in pushbutton5.


function pushbutton5_Callback(hObject, eventdata, handles)
A=zeros(16);
A(1,1)=-1;
A(1,4)=1;
A(1,3)=sin(pi/4);
A(2,2)=-1;
A(2,3)=cos(pi/4);
A(3,4)=-1;
A(3,5)=sin(pi/4);
A(4,6)=1;
A(4,5)=cos(pi/4);
A(5,5)=-sin(pi/4);
A(5,7)=-1;
A(6,10)=1;
A(6,5)=-cos(pi/4);
A(7,7)=1;
A(7,8)=sin(pi/4);
A(7,3)=-sin(pi/4);
A(8,8)=cos(pi/4);
A(8,9)=1;
A(8,6)=-1;
A(8,3)=-cos(pi/4);
A(9,8)=-sin(pi/4);
A(9,11)=-sin(pi/4);
A(10,12)=1;
A(10,11)=cos(pi/4);
A(10,10)=-1;
A(10,8)=-cos(pi/4);
A(11,14)=-1;
A(11,13)=-sin(pi/4);
A(12,13)=cos(pi/4);
A(12,12)=-1;
A(13,11)=sin(pi/4);
A(13,14)=1;
A(14,15)=1;
A(14,9)=-1;
A(14,11)=-cos(pi/4);
A(15,13)=sin(pi/4);
A(15,16)=-1;
A(16,13)=-cos(pi/4);
A(16,15)=-1;
set(handles.uitable1,'data',A);

E1=eval(get(handles.edit17,'string'));
E2=eval(get(handles.edit19,'string'));
E3=eval(get(handles.edit18,'string'));
B=[0;0;0;0;0;0;0;0;E1;0;0;-E3;E2;0;0;0];
set(handles.uitable2,'data',B);

X=inv(A)*B;
set(handles.uitable5,'data',X);

set(handles.edit1,'string',-X(1))
set(handles.edit2,'string',-X(2))
set(handles.edit4,'string',X(3))
set(handles.edit3,'string',X(4))
set(handles.edit6,'string',X(5))
set(handles.edit5,'string',X(6))
set(handles.edit7,'string',X(7))
set(handles.edit9,'string',X(8))
set(handles.edit10,'string',X(9))
set(handles.edit8,'string',X(10))
set(handles.edit11,'string',X(11))
set(handles.edit12,'string',X(12))
set(handles.edit14,'string',X(13))
set(handles.edit13,'string',X(14))
set(handles.edit15,'string',X(15))
set(handles.edit16,'string',-X(16))

function edit17_Callback(hObject, eventdata, handles)


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

% Hints: get(hObject,'String') returns contents of edit17


as text
% str2double(get(hObject,'String')) returns contents
of edit17 as a double

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


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

% Hint: edit 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

function edit18_Callback(hObject, eventdata, handles)


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

% Hints: get(hObject,'String') returns contents of edit18


as text
% str2double(get(hObject,'String')) returns contents
of edit18 as a double

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


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

% Hint: edit 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

function edit19_Callback(hObject, eventdata, handles)


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

% Hints: get(hObject,'String') returns contents of edit19


as text
% str2double(get(hObject,'String')) returns contents
of edit19 as a double

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


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

% Hint: edit 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

También podría gustarte