function varargout = DataProcessing(varargin)
% DATAPROCESSING M-file for DataProcessing.fig
% DATAPROCESSING, by itself, creates a new DATAPROCESSING or raises the existing
% singleton*.
%
% H = DATAPROCESSING returns the handle to a new DATAPROCESSING or the handle to
% the existing singleton*.
%
% DATAPROCESSING('CALLBACK',hObject,eventData,handles,...) calls the local
% function named CALLBACK in DATAPROCESSING.M with the given input arguments.
%
% DATAPROCESSING('Property','Value',...) creates a new DATAPROCESSING or raises the
% existing singleton*. Starting from the left, property value pairs are
% applied to the GUI before DataProcessing_OpeningFunction gets called. An
% unrecognized property name or invalid value makes property application
% stop. All inputs are passed to DataProcessing_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
% Copyright 2002-2003 The MathWorks, Inc.
% Edit the above text to modify the response to help DataProcessing
% Last Modified by GUIDE v2.5 19-Jun-2012 11:19:28
% Begin initialization code - DO NOT EDIT
gui_Singleton = 1;
gui_State = struct('gui_Name', mfilename, ...
'gui_Singleton', gui_Singleton, ...
'gui_OpeningFcn', @DataProcessing_OpeningFcn, ...
'gui_OutputFcn', @DataProcessing_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 DataProcessing is made visible.
function DataProcessing_OpeningFcn(hObject, eventdata, handles, varargin)
% backgroundImage=importdata('computer_kuan_344803_8.jpg');
% axes(handles.picture);
% image(backgroundImage);
% axis off;
% 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 DataProcessing (see VARARGIN)
% Choose default command line output for DataProcessing
handles.output = hObject;
% Update handles structure
guidata(hObject, handles);
% UIWAIT makes DataProcessing wait for user response (see UIRESUME)
% uiwait(handles.figure1);
% --- Outputs from this function are returned to the command line.
function varargout = DataProcessing_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;
% --- Executes on button press in ImportData.
function ImportData_Callback(hObject, eventdata, handles)
str=get(handles.wave_num,'string');
val=str2num(str);
if ~isempty(val)&&(val>=1&&val<182)
global str_out;
originaldata=load(str_out);
k=size(originaldata);
t=1:k(2);
% index=get(handles.DirSaveFile,'string');
if ~isempty(str_out)
axes(handles.OriginalWave);
global wave_1;
wave_1=originaldata(val,:);
plot(t,originaldata(val,:));
s=max(originaldata(val,:))-min(originaldata(val,:));
s=s*1000;
s_str=num2str(s);
set(handles.MaxMin,'String',s_str);
end
end
% hObject handle to ImportData (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% --- If Enable == 'on', executes on mouse press in 5 pixel border.
% --- Otherwise, executes on mouse press in 5 pixel border or over ImportData.
% --- Executes on button press in PeakValue.
function ImportData_DeleteFcn(hObject, eventdata, handles)
% hObject handle to ImportData (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% --- Executes during object deletion, before destroying properties.
function fft_CreateFcn(hObject, eventdata, handles)
axis on;
% hObject handle to fft (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 fft
% --- Executes during object creation, after setting all properties.
function OriginalWave_CreateFcn(hObject, eventdata, handles)
axis on;
% hObject handle to OriginalWave (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 OriginalWave
% --- Executes on button press in SeriesWave.
function SeriesWave_Callback(hObject, eventdata, handles)
%dir_name=uigetdir('D:\');
global fname;
global pname;
[fname,pname,index]=uigetfile('.3df','打开原始指向性波形文件','D:\');
global str_in;
if index
set(handles.dir_pname,'String',fname);
str_in=strcat(pname,fname);%导入的指向性原始文件路径名
end
% hObject handle to SeriesWave (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% --- Executes on button press in dir_savefile.
function dir_savefile_Callback(hObject, eventdata, handles)
% hObject handle to dir_savefile (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
function wave_num_Callback(hObject, eventdata, handles)
% hObject handle to wave_num (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 wave_num as text
% str2double(get(hObject,'String')) returns contents of wave_num as a double
% --- Executes during object creation, after setting all properties.
function wave_num_CreateFcn(hObject, eventdata, handles)
% hObject handle to wave_num (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 wave_start_Callback(hObject, eventdata, handles)
% hObject handle to wave_start (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 wave_start as text
% str2double(get(hObject,'String')) returns contents of wave_start as a double
% --- Executes during object creation, after setting all properties.
function wave_start_CreateFcn(hObject, eventdata, handles)
% hObject handle to wave_start (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,'defaultUicontrolBackg