function varargout = process_gui(varargin)
% PROCESS_GUI MATLAB code for process_gui.fig
% PROCESS_GUI, by itself, creates a new PROCESS_GUI or raises the existing
% singleton*.
%
% H = PROCESS_GUI returns the handle to a new PROCESS_GUI or the handle to
% the existing singleton*.
%
% PROCESS_GUI('CALLBACK',hObject,eventData,handles,...) calls the local
% function named CALLBACK in PROCESS_GUI.M with the given input arguments.
%
% PROCESS_GUI('Property','Value',...) creates a new PROCESS_GUI or raises the
% existing singleton*. Starting from the left, property value pairs are
% applied to the GUI before process_gui_OpeningFcn gets called. An
% unrecognized property name or invalid value makes property application
% stop. All inputs are passed to process_gui_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 process_gui
% Last Modified by GUIDE v2.5 29-Aug-2017 16:23:10
% Begin initialization code - DO NOT EDIT
gui_Singleton = 1;
gui_State = struct('gui_Name', mfilename, ...
'gui_Singleton', gui_Singleton, ...
'gui_OpeningFcn', @process_gui_OpeningFcn, ...
'gui_OutputFcn', @process_gui_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 process_gui is made visible.
function process_gui_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 process_gui (see VARARGIN)
% Choose default command line output for process_gui
handles.output = hObject;
% Update handles structure
guidata(hObject, handles);
% UIWAIT makes process_gui wait for user response (see UIRESUME)
% uiwait(handles.figure1);
% --- Outputs from this function are returned to the command line.
function varargout = process_gui_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 selection change in listbox1.
function listbox1_Callback(hObject, eventdata, handles)
% hObject handle to listbox1 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hints: contents = cellstr(get(hObject,'String')) returns listbox1 contents as cell array
% contents{get(hObject,'Value')} returns selected item from listbox1
% --- Executes during object creation, after setting all properties.
function listbox1_CreateFcn(hObject, eventdata, handles)
% hObject handle to listbox1 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns called
% Hint: listbox 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)
% hObject handle to pushbutton1 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
axes(handles.axes1) ;
cla reset
fs=2000*2.56; % 采样率
load data.mat
t=0:1/fs:(length(signal(1,:))-1)/fs; %以时间为横坐标
signal_type = get(handles.signal,'Value') ;
switch signal_type
case 1
signaldo=signal(1,:);
case 2
signaldo=signal(2,:);
case 3
signaldo=signal(3,:);
case 4
signaldo=signal(4,:);
end
signalnew=wden(signaldo,'minimaxi','s','mln',5,'sym5'); %小波分解去噪
axes(handles.axes1);
plot(t,signaldo,'-b');hold on;
plot(t,signalnew,'-r');
xlim([0,11]);ylabel('加速度');xlabel('时间(s)');
legend('去噪前','去噪后');
feature(1)=max(signalnew); %特征1 max
feature(2)=min(signalnew); %特征2 min
feature(3)=mean(signalnew); %特征3 mean
feature(4)=var(signalnew); %特征4 方差
feature(5)=std(signalnew); %特征5 均方根
set(handles.edit1,'String',num2str(feature(1)));
set(handles.edit2,'String',num2str(feature(2)));
set(handles.edit3,'String',num2str(feature(3)));
set(handles.edit4,'String',num2str(feature(4)));
set(handles.edit5,'String',num2str(feature(5)));
% --- Executes on button press in pushbutton2.
function pushbutton2_Callback(hObject, eventdata, handles)
% hObject handle to pushbutton2 (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 pushbutton3.
function pushbutton3_Callback(hObject, eventdata, handles)
% hObject handle to pushbutton3 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
axes(handles.axes1) ;
cla reset
fs=2000*2.56; % 采样率
load data.mat
t=0:1/fs:(length(signal(1,:))-1)/fs; %以时间为横坐标
signal_type = get(handles.signal,'Value') ;
switch signal_type
case 1
signaldo=signal(1,:);
case 2
signaldo=signal(2,:);
case 3
signaldo=signal(3,:);
case 4
signaldo=signal(4,:);
end
signalnew=wden(signaldo,'minimaxi','s','mln',5,'sym5'); %小波分解去噪
signalnew=signalnew./max(abs(signalnew)); %归一化
axes(handles.axes1);
plot(t,signalnew,'-k');
xlim([0,11]);ylabel('加速度');xlabel('时间(s)');
feature(1)=max(signalnew); %特征1 max
feature(2)=min(signalnew); %特征2 min
feature(3)=mean(signalnew); %特征3 mean
feature(4)=var(signalnew); %特征4 方差
feature(5)=std(signalnew); %特征5 均方根
set(handles.edit1,'String',num2str(feature(1)));
set(handles.edit2,'String',num2str(feature(2)));
set(handles.edit3,'String',num2str(feature(3)));
set(handles.edit4,'String',num2str(feature(4)));
set(handles.edit5,'String',num2str(feature(5)));
function edit1_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 edit1_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 edit2_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:
没有合适的资源?快使用搜索试试~ 我知道了~
温馨提示
CSDN海神之光上传的全部代码均可运行,亲测可用,尽我所能,为你服务; 1、代码压缩包内容 主函数:process_gui.m; 调用函数:其他m文件;无需运行 运行结果效果图; 2、代码运行版本 Matlab 2019b;若运行有误,根据提示修改;若不会,可私信博主; 3、运行操作步骤 步骤一:将所有文件放到Matlab的当前文件夹中; 步骤二:双击打开process_gui.m文件; 步骤三:点击运行,等程序运行完得到结果; 4、物理应用 仿真:导航、地震、电磁、电路、电能、机械、工业控制、水位控制、直流电机、平面电磁波、管道瞬变流 光学:光栅、杨氏双缝、单缝、多缝、圆孔、矩孔衍射、夫琅禾费、干涉、拉盖尔高斯、光束、光波、涡旋 定位问题:chan、taylor、RSSI、music、卡尔曼滤波UWB 气动学:弹道、气体扩散、龙格库弹道 运动学:倒立摆、泊车 天体学:卫星轨道、姿态
资源推荐
资源详情
资源评论
收起资源包目录
【齿轮设计】基于matlab GUI齿轮箱振动数据分析【含Matlab源码 2973期】.zip (8个子文件)
【齿轮设计】基于matlab GUI齿轮箱振动数据分析【含Matlab源码 2973期】
运行结果1.jpg 139KB
process_gui.m 14KB
运行结果2.jpg 154KB
运行结果4.jpg 116KB
process_gui.fig 38KB
process.m 4KB
data.mat 475KB
运行结果3.jpg 116KB
共 8 条
- 1
资源评论
- weixin_582741802023-12-07资源值得借鉴的内容很多,那就浅学一下吧,值得下载!
海神之光
- 粉丝: 3w+
- 资源: 2094
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功