资源简介
MATLAB实现GUI实现串口通讯 十六进制通讯
代码片段和文件信息
function varargout = zhengshi(varargin)
gui_Singleton = 1;
gui_State = struct(‘gui_Name‘ mfilename ...
‘gui_Singleton‘ gui_Singleton ...
‘gui_OpeningFcn‘ @zhengshi_OpeningFcn ...
‘gui_OutputFcn‘ @zhengshi_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
function zhengshi_OpeningFcn(hobject eventdata handles varargin)
handles.output = hobject;
javaframe = get(hobject‘Javaframe‘);
javaframe.setFigureIcon(javax.swing.ImageIcon(‘icon.jpg‘));
guidata(hobject handles);
function varargout = zhengshi_OutputFcn(hobject eventdata handles)
varargout{1} = handles.output;
function com_Callback(hobject eventdata handles)
function com_CreateFcn(hobject eventdata handles)
if ispc && isequal(get(hobject‘BackgroundColor‘) get(0‘defaultUicontrolBackgroundColor‘))
set(hobject‘BackgroundColor‘‘white‘);
end
function rate_Callback(hobject eventdata handles)
function rate_CreateFcn(hobject eventdata handles)
if ispc && isequal(get(hobject‘BackgroundColor‘) get(0‘defaultUicontrolBackgroundColor‘))
set(hobject‘BackgroundColor‘‘white‘);
end
function jiaoyan_Callback(hobject eventdata handles)
function jiaoyan_CreateFcn(hobject eventdata handles)
if ispc && isequal(get(hobject‘BackgroundColor‘) get(0‘defaultUicontrolBackgroundColor‘))
set(hobject‘BackgroundColor‘‘white‘);
end
function data_bits_Callback(hobject eventdata handles)
function data_bits_CreateFcn(hobject eventdata handles)
if ispc && isequal(get(hobject‘BackgroundColor‘) get(0‘defaultUicontrolBackgroundColor‘))
set(hobject‘BackgroundColor‘‘white‘);
end
function stop_bits_Callback(hobject eventdata handles)
function stop_bits_CreateFcn(hobject eventdata handles)
if ispc && isequal(get(hobject‘BackgroundColor‘) get(0‘defaultUicontrolBackgroundColor‘))
set(hobject‘BackgroundColor‘‘white‘);
end
function start_serial_Callback(hobject eventdata handles)
global scom
if get(hobject‘value‘)
com_n=sprintf(‘com%d‘get(handles.com‘value‘));
rates=[300 600 1200 2400 4800 9600 19200 38400 43000 56000 57600 115200];
baud_rate=rates(get(handles.rate‘value‘));
switch get(handles.jiaoyan‘value‘)
case 1
jiaoyan=‘none‘;
case 2
jiaoyan=‘odd‘;
case 3
jiaoyan=‘even‘;
end
data_bits=5+get(handles.data_bits‘value‘);
stop_bits=get(handles.stop_bits‘value‘);
scom=serial(com_n);
set(scom‘BaudRate‘baud_rate‘Parity‘jiaoyan‘DataBits‘...
data_bits‘StopBits‘stop_bits‘BytesAvailableFcnCount‘100...
‘BytesAvailableFcnMode‘‘byte‘‘BytesAvailableFcn‘{@byteshandles}...
‘TimerPeriod‘0
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 6838 2012-05-14 18:34 my code\zhengshi.asv
文件 7174 2012-05-14 16:26 my code\zhengshi.fig
文件 6896 2012-05-14 18:46 my code\zhengshi.m
文件 3584 2012-05-14 16:26 my code\zhengshi_activex1
目录 0 2012-05-14 18:48 my code
----------- --------- ---------- ----- ----
24492 5
相关资源
- FIR低通滤波器+matlab程序
- 三相电压型逆变电路MATLAB仿真报告
- 基于SVPWM的三电平逆变的matlab 仿真模
- 经典GNSS卫星导航程序.rar
- matlab中cplex和yalmip新手指南
- 聚类有效性评价计算 MATLAB编写
- matlab的卡方拟合检验
- 光伏电池板 pv matlab模型
- matlab音频读写,录制与播放
- 数值计算实验报告matlab版
- 基于MATLAB的canny算子
- 基于小波变换的图像去噪的matlab程序
- Dijkstra、Floyd算法MatlabLingo实现
- matlab指纹识别带GUI
- G-Rilling EMD HHT Matlab 开源代码
- matlab求解一个典型偏微分方程代码
- matlab联合STK进行北斗卫星运行仿真
- TDOA常见算法的MATLAB源代码
- 《精通Matlab最优化计算》配套Matlab代
- 带端点延拓的EMD和原始EMD的matlab程序
- 基于MATLAB的两电平逆变仿真模型
- matlab视频教程很全的
- OFDM同步算法的仿真matlab
- EKFUKFPF2 三种滤波算法的比较
- 多分类问题中混淆矩阵(Confusion Mat
- 均匀布拉格光栅的原理及MATLAB反射谱
- matlab三体运动模拟程序
- OFDM QPSK调制解调
- fastslam matlab 仿真算法
- matlabGUI 音频文件的滤波程序包含低频
评论
共有 条评论