• 大小: 3KB
    文件类型: .rar
    金币: 1
    下载: 0 次
    发布日期: 2021-04-21
  • 语言: Matlab
  • 标签: 串口  MATLAB  

资源简介

matlab实现的串口采样数据的曲线绘制,能够设置串口编号。

资源截图

代码片段和文件信息

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

% Last Modified by GUIDE v2.5 05-Jun-2009 12:39:52

% Begin initialization code - DO NOT EDIT
gui_Singleton = 1;
gui_State = struct(‘gui_Name‘       mfilename ...
                   ‘gui_Singleton‘  gui_Singleton ...
                   ‘gui_OpeningFcn‘ @SerialPortCommunication_OpeningFcn ...
                   ‘gui_OutputFcn‘  @SerialPortCommunication_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 when user attempts to close figure1.
function figure1_CloseRequestFcn(hobject eventdata handles)
% hobject    handle to figure1 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
% Hint: delete(hobject) closes the figure
global number;
global o_SerialPort;
%--------------关闭串口-------------------------------
if strcmp(o_SerialPort.Status‘open‘)
        fclose(o_SerialPort);
end
number=[];
clear number;
delete(hobject);

% --- Executes just before SerialPortCommunication is made visible.
function SerialPortCommunication_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 SerialPortCommunication (see VARARGIN)

% Choose default command line output for SerialPortCommunication
h

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件      17433  2009-06-05 12:47  SerialPortCommunication.m

----------- ---------  ---------- -----  ----

                17433                    1


评论

共有 条评论