【肌电信号】基于matlab GUI MUAP波形【含Matlab源码 736期】

149 阅读3分钟

一、简介

基于matlab GUI肌电信号MUAP波形

二、源代码

function varargout = MUAPgui(varargin)
% MUAPGUI M-file for MUAPgui.fig
%      MUAPGUI, by itself, creates a new MUAPGUI or raises the existing
%      singleton*.
%
%      H = MUAPGUI returns the handle to a new MUAPGUI or the handle to
%      the existing singleton*.
%
%      MUAPGUI('CALLBACK',hObject,eventData,handles,...) calls the local
%      function named CALLBACK in MUAPGUI.M with the given input arguments.
%
%      MUAPGUI('Property','Value',...) creates a new MUAPGUI or raises the
%      existing singleton*.  Starting from the left, property value pairs are
%      applied to the GUI before MUAPgui_OpeningFunction gets called.  An
%      unrecognized property name or invalid value makes property application
%      stop.  All inputs are passed to MUAPgui_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 MUAPgui

% Last Modified by GUIDE v2.5 27-Dec-2006 12:09:22

% Begin initialization code - DO NOT EDIT
gui_Singleton = 1;
gui_State = struct('gui_Name',       mfilename, ...
                   'gui_Singleton',  gui_Singleton, ...
                   'gui_OpeningFcn', @MUAPgui_OpeningFcn, ...
                   'gui_OutputFcn',  @MUAPgui_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 MUAPgui is made visible.
function MUAPgui_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 MUAPgui (see VARARGIN)

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

% Update handles structure
guidata(hObject, handles);
clear all;
% UIWAIT makes MUAPgui wait for user response (see UIRESUME)
% uiwait(handles.figure1);


% --- Outputs from this function are returned to the command line.
function varargout = MUAPgui_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 Laplace.
function Laplace_Callback(hObject, eventdata, handles)
% hObject    handle to Laplace (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)

global muap;
lapmuap=4*muap(2,:)-muap(1,:)-muap(3,:)-muap(4,:)-muap(5,:);
axes(handles.axes1);
HH=plot(lapmuap);
set(HH,'LineWidth',2);
clear HH;

% --- Executes on button press in Bipolar.
function Bipolar_Callback(hObject, eventdata, handles)
% hObject    handle to Bipolar (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
global muap;

biomuap=muap(1,:)-muap(2,:);
axes(handles.axes2);
HH=plot(biomuap);
set(HH,'LineWidth',2);
clear HH;

% --- Executes on button press in Monopolar.
function Monopolar_Callback(hObject, eventdata, handles)
% hObject    handle to Monopolar (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)

global muap;

axes(handles.axes3);
HH=plot(muap(2,:));
set(HH,'LineWidth',2);
clear HH;

function nf_Callback(hObject, eventdata, handles)
% hObject    handle to nf (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 nf as text
%        str2double(get(hObject,'String')) returns contents of nf as a double


% --- Executes during object creation, after setting all properties.
function nf_CreateFcn(hObject, eventdata, handles)
% hObject    handle to nf (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
    set(hObject,'BackgroundColor','white');
else
    set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor'));
end



function skinfat_Callback(hObject, eventdata, handles)
% hObject    handle to skinfat (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 skinfat as text
%        str2double(get(hObject,'String')) returns contents of skinfat as a double


% --- Executes during object creation, after setting all properties.
function skinfat_CreateFcn(hObject, eventdata, handles)
% hObject    handle to skinfat (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
    set(hObject,'BackgroundColor','white');
else
    set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor'));
end



function x_Callback(hObject, eventdata, handles)
% hObject    handle to x (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 x as text
%        str2double(get(hObject,'String')) returns contents of x as a double


% --- Executes during object creation, after setting all properties.
function x_CreateFcn(hObject, eventdata, handles)
% hObject    handle to x (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 ave a white background on Windows.
%       See ISPC and COMPUTER.
if ispc
    set(hObject,'BackgroundColor','white');
else
    set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor'));
end

三、运行结果

在这里插入图片描述
在这里插入图片描述

四、备注

版本:2014a