function varargout = aero(varargin)
clc
gui_Singleton = 1;
gui_State = struct('gui_Name', mfilename, ...
'gui_Singleton', gui_Singleton, ...
'gui_OpeningFcn', @aero_OpeningFcn, ...
'gui_OutputFcn', @aero_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 aero is made visible.
function aero_OpeningFcn(hObject, eventdata, handles, varargin)
set(handles.axes1,'Visible','off');
set(handles.axes2,'Visible','off');
handles.output = hObject;
guidata(hObject, handles);
% --- Outputs from this function are returned to the command line.
function varargout = aero_OutputFcn(hObject, eventdata, handles)
varargout{1} = handles.output;
% --- Executes on button press in Boton_introducir.
function Boton_introducir_Callback(hObject, ~, handles)
[filename pathname] = uigetfile( '*.dat');
handles.carga = load([pathname,filename]) ;
set(handles.uitable1,'data',handles.carga) ;
axes(handles.axes1);
plot(handles.carga(:,1),handles.carga(:,2),'bo-');
set(handles.axes1,'Visible','on');
guidata(hObject,handles);
% --- Executes on button press in Boton_guardar.
function Boton_guardar_Callback(hObject, eventdata, handles)
[filename pathname] = uiputfile( '*.dat');
if filename==0
return;
else
datos_nuevos=handles.datosnuevos;
fid=fopen([pathname, filename],'w');
fprintf(fid,'%d\t%d\n',datos_nuevos');
fclose(fid);
end
guidata(hObject,handles);
function edit1_Callback(hObject, eventdata, handles)
% --- Executes during object creation, after setting all properties.
function edit1_CreateFcn(hObject, eventdata, handles)
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
set(hObject,'BackgroundColor','white');
end
% --- Executes on button press in Boton_desplazar.
function Boton_desplazar_Callback(hObject, ~, handles)
datos=get(handles.uitable1,'data');
desplazar=get(handles.edit1,'String');
desplazar=str2num(desplazar);
vector_desplazar=desplazar*ones(length(datos),1);
datos_nuevos_x=datos(:,1)+vector_desplazar;
datos_nuevos_y=datos(:,2);
datos_nuevos=[datos_nuevos_x,datos_nuevos_y];
handles.datosnuevos=datos_nuevos;
set(handles.uitable2,'data',handles.datosnuevos);
axes(handles.axes2);
plot(handles.datosnuevos(:,1),handles.datosnuevos(:,2),'bo-');
set(handles.axes2,'Visible','on');
guidata(hObject,handles);