Ingenieria civil

Solo disponible en BuenasTareas
  • Páginas : 7 (1735 palabras )
  • Descarga(s) : 0
  • Publicado : 18 de marzo de 2011
Leer documento completo
Vista previa del texto
USO DE FUNCIONES GET Y SET EN GUIDE DE MATLAB

Get.- sirve para obtener los valores de un objeto.

get(handles.nombre_objeto,’parametro’)

Set.- Sirve para asignar valores a un parámetro especifico de un objeto.

set(handles.nombre_objeto,’parametro’,valor)

handles.- Sirve para manejar a un objeto.
str2double.- convierte un tipo caracter a un tipo numérico

EJEMPLO N°1CÓDIGO DEL ARCHIVO m.

function varargout = armaduras(varargin)
% Edit the above text to modify the response to help armaduras
% Last Modified by GUIDE v2.5 01-Feb-2011 11:13:10
% Begin initialization code - DO NOT EDIT
gui_Singleton = 1;
gui_State = struct('gui_Name', mfilename, ...
'gui_Singleton', gui_Singleton, ...
'gui_OpeningFcn',@armaduras_OpeningFcn, ...
'gui_OutputFcn', @armaduras_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% --- Executes just before armaduras is made visible.
function armaduras_OpeningFcn(hObject, eventdata, handles, varargin)

%%%IMPRIMIENDO IMAGEN DE ARMADURA%%%%%%%%%
LOGO1=imread('FOTO1.jpg');
axes(handles.axes1);
imshow(LOGO1);

% Choose default command line output for armaduras
handles.output = hObject;

% Update handles structure
guidata(hObject, handles);


functionvarargout = armaduras_OutputFcn(hObject, eventdata, handles)

varargout{1} = handles.output;


% --- Executes on button press in pushbutton1.
function pushbutton1_Callback(hObject, eventdata, handles)
% hObject handle to pushbutton1 (see GCBO)
% handles structure with handles and user data (see GUIDATA)
FX1=str2double(get(handles.edit1,'string'));FY1=str2double(get(handles.edit2,'string'));
FX2=str2double(get(handles.edit3,'string'));
FY2=str2double(get(handles.edit4,'string'));
FX3=str2double(get(handles.edit5,'string'));
FY3=str2double(get(handles.edit6,'string'));
FX4=str2double(get(handles.edit7,'string'));
FY4=str2double(get(handles.edit8,'string'));
FX5=str2double(get(handles.edit9,'string'));
FY5=str2double(get(handles.edit10,'string'));FX6=str2double(get(handles.edit11,'string'));
FY6=str2double(get(handles.edit12,'string'));
a=str2double(get(handles.edit13,'string'));
b=str2double(get(handles.edit14,'string'));
c=str2double(get(handles.edit15,'string'));
d=str2double(get(handles.edit16,'string'));
e=str2double(get(handles.edit17,'string'));
%%%CREANDO LA MATRIZ DE COEFICIENTES %%%%%%%%
mtz=zeros(16);
mtz(1,1)=1;
mtz(1,3)=1;
mtz(2,2)=1;mtz(3,4)=-1;
mtz(3,6)=1;
mtz(4,5)=1;
mtz(5,8)=1;
mtz(6,5)=-1;
mtz(7,6)=-1;
mtz(7,10)=1;
mtz(8,9)=1;
mtz(9,8)=-1;
mtz(10,9)=-1;mtz(11,10)=-1;mtz(13,12)=-1;mtz(14,13)=1;mtz(15,14)=1;
mtz(16,16)=1;mtz(1,1)=1;
mtz(1,4)=a/sqrt(a^2+e^2);mtz(2,4)=e/sqrt(a^2+e^2);mtz(5,4)=-a/sqrt(a^2+e^2);mtz(5,7)=b/sqrt(b^2+e^2);
mtz(6,4)=-e/sqrt(a^2+e^2);mtz(6,7)=-e/sqrt(b^2+e^2);mtz(7,7)=-b/sqrt(b^2+e^2);mtz(7,11)=c/sqrt(c^2+e^2)
mtz(8,7)=e/sqrt(b^2+e^2); mtz(8,11)=e/sqrt(c^2+e^2);mtz(13,11)=-c/sqrt(c^2+e^2);mtz(13,15)=d/sqrt(d^2+e^2);
mtz(14,11)=e/sqrt(c^2+e^2);mtz(14,15)=e/sqrt(d^2+e^2);mtz(15,15)=d/sqrt(d^2+e^2);mtz(16,15)=-e/sqrt(d^2+e^2);
mtz; %%% mtz ES LA MATRIZ DE COEFICIENTES

%%%%%%%%CREANDO EL VECTOR DEL SISTEMA%%%%%
vect=zeros(16,1)vect(3,1)=-FX4;vect(4,1)=-FY4;vect(5,1)=-FX1;vect(6,1)=-FY1;vect(7,1)=-FX5;vect(8,1)=-FY5;vect(9,1)=-FX2;
vect(10,1)=-FY2;vect(11,1)=-FX6;vect(12,1)=-FY6;vect(13,1)=-FX3;vect(14,1)=-FY3;
vect;
%%%%%%%%%%%%%%%
%%%IMPRIMIENDO LA MATRIZ DE COEFICIENTES EN LA INTERFAZ %%%%%%%%%%%
celda1=cell(16,1);
celda1(:,:)={''};
set(handles.tabla2,'Data',celda1)
set(handles.tabla2,'Data',vect)
%%%%%%%%%%%%%%
%%%%IMPRIMIENDO EL VECTOR DEL SISTEMA...
tracking img