一、获取代码方式

获取代码方式1:
完整代码已上传我的资源:【物理应用】基于matlab GUI家庭室内温湿度控制【含Matlab源码 326期】

获取代码方式2:
通过订阅紫极神光博客付费专栏,凭支付凭证,私信博主,可获得此代码。

备注:
订阅紫极神光博客付费专栏,可免费获得1份代码(有效期为订阅日起,三天内有效);

二、部分源代码

function varargout = HomeMonitoringSystem(varargin)
% HOMEMONITORINGSYSTEM MATLAB code for HomeMonitoringSystem.fig
%      HOMEMONITORINGSYSTEM, by itself, creates a new HOMEMONITORINGSYSTEM or raises the existing
%      singleton*.
%
%      H = HOMEMONITORINGSYSTEM returns the handle to a new HOMEMONITORINGSYSTEM or the handle to
%      the existing singleton*.
%
%      HOMEMONITORINGSYSTEM('CALLBACK',hObject,eventData,handles,...) calls the local
%      function named CALLBACK in HOMEMONITORINGSYSTEM.M with the given input arguments.
%
%      HOMEMONITORINGSYSTEM('Property','Value',...) creates a new HOMEMONITORINGSYSTEM or raises the
%      existing singleton*.  Starting from the left, property value pairs are
%      applied to the GUI before HomeMonitoringSystem_OpeningFcn gets called.  An
%      unrecognized property name or invalid value makes property application
%      stop.  All inputs are passed to HomeMonitoringSystem_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 HomeMonitoringSystem% Last Modified by GUIDE v2.5 09-Apr-2013 21:36:08% Begin initialization code - DO NOT EDIT
gui_Singleton = 1;
gui_State = struct('gui_Name',       mfilename, ...'gui_Singleton',  gui_Singleton, ...'gui_OpeningFcn', @HomeMonitoringSystem_OpeningFcn, ...'gui_OutputFcn',  @HomeMonitoringSystem_OutputFcn, ...'gui_LayoutFcn',  [] , ...'gui_Callback',   []);
if nargin && ischar(varargin{1})gui_State.gui_Callback = str2func(varargin{1});
endif nargout[varargout{1:nargout}] = gui_mainfcn(gui_State, varargin{:});
elsegui_mainfcn(gui_State, varargin{:});
end
% End initialization code - DO NOT EDIT% --- Executes just before HomeMonitoringSystem is made visible.
function HomeMonitoringSystem_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 HomeMonitoringSystem (see VARARGIN)% Choose default command line output for HomeMonitoringSystem
handles.output = hObject;
web -browser http://www.ilovematlab.cn/thread-201914-1-1.html
% Update handles structureglobal smtp_server_status camera_working  temp_humd_workingsmtp_server_status=0; %邮件系统是否工作 Email System Status
camera_working=0;%相机是否能工作 Camera can work or not?
temp_humd_working=0; %温度计、湿度计是否在工作 temperature/humidity sensor works or not?handles.live_view=0; %系统是否在监视
handles.receiver1='';%接受人邮件地址
handles.receiver2='';
handles.receiver3='';%默认为中文界面  By Default, load the Chinese GUI
handles.my_gui_msg_struct = msg_cn();
guidata(hObject, handles);%删除所有现有的计时器
%Delete all timers in the system
tryout = timerfind;stop(out);delete(out);
catch exception
end% UIWAIT makes HomeMonitoringSystem wait for user response (see UIRESUME)
% uiwait(handles.figure1);% --- Outputs from this function are returned to the command line.
function varargout = HomeMonitoringSystem_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;% --------------------------------------------------------------------
function Untitled_1_Callback(hObject, eventdata, handles)
% hObject    handle to Untitled_1 (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 PB_real_time_video.
function PB_real_time_video_Callback(hObject, eventdata, handles)
% hObject    handle to PB_real_time_video (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
% UD_capture_image(hObject,handles);
%
% TM_video = timer('TimerFcn',{@UD_capture_image,hObject,handles}, 'Period', 0.5);
% start(TM_video);%相机是否能正常工作,只有获取第一副图片以后,该状态才被改变
%The camera is working unless one image is captured
global camera_working
camera_working=0;
warning('off');
guidata(hObject, handles);% 判断系统是否已经有定时器在运行,若是,则删除现有的定时器
% Determine if it is already running. Stop the timer is so.
tryout = timerfind('Tag', 'Continuous Capture');stop(out);delete(out);
catch exception
end% 获得帧数
% Get the fps from GUI
tryvideo_fs=1/str2num(get(handles.TE_video_fs,'string'));if str2num(get(handles.TE_video_fs,'string'))<0 | str2num(get(handles.TE_video_fs,'string'))>100throw(exception);endcatch exceptionmsgbox(handles.my_gui_msg_struct.live_view_wrong_fps);return;
end% 获取抓取图片的URL链接
% Get the URL for image capture
handles.image_url=get(handles.TE_image_url,'string');% 定义一个全局变量,用于储存网络摄像头的用户名和密码
% Define a global variable to store username and password
global global_url_pwd;
global_url_pwd=base64_encode(get(handles.TE_url_pwd,'string'));% 创建一个计时器,回调函数为UD_capture_image
% Create a timer with callback UD_capture_image
handles.UD_continuous_capture_timer = timer('Tag','Continuous Capture','period',video_fs);
set(handles.UD_continuous_capture_timer,'ExecutionMode','fixedrate','StartDelay',0.5);
set(handles.UD_continuous_capture_timer,'TimerFcn',{@UD_capture_image,hObject,handles});
start(handles.UD_continuous_capture_timer);
guidata(hObject, handles);function UD_capture_image(~, ~, hObject,handles)% 读取图片
% Read an image
tryhandles.raw_image=imread_auth(handles.image_url);
catch exceptionmsgbox(handles.my_gui_msg_struct.live_view_wrong_URL_username_password);tryout = timerfind('Tag', 'Continuous Capture')stop(out);delete(out);catch exception2endreturn;
end
% 显示图片,更新状态
% show the image, Update System Status
handles.live_view=1;
global camera_working
camera_working=1;
guidata(hObject, handles);
imshow(handles.raw_image,'Parent',handles.AX_video);% --- Executes on button press in PB_stop_real_time_video.
function PB_stop_real_time_video_Callback(hObject, eventdata, handles)
% hObject    handle to PB_stop_real_time_video (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)tryout = timerfind('Tag', 'Continuous Capture');stop(out);delete(out);
catch exception
end
handles.live_view=0;
guidata(hObject, handles);% --- 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
% delete(hObject);% Delte all timers
tryout = timerfind;stop(out);delete(out);
catch exception
end
web -browser http://www.ilovematlab.cn/thread-201914-1-1.html
delete(hObject);function TE_video_fs_Callback(hObject, eventdata, handles)
% hObject    handle to TE_video_fs (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 TE_video_fs as text
%        str2double(get(hObject,'String')) returns contents of TE_video_fs as a double% --- Executes during object creation, after setting all properties.
function TE_video_fs_CreateFcn(hObject, eventdata, handles)
% hObject    handle to TE_video_fs (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% --- Executes on button press in CB_monday.
function CB_monday_Callback(hObject, eventdata, handles)
% hObject    handle to CB_monday (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)% Hint: get(hObject,'Value') returns toggle state of CB_monday% --- Executes on button press in CB_tuesday.
function CB_tuesday_Callback(hObject, eventdata, handles)
% hObject    handle to CB_tuesday (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)% Hint: get(hObject,'Value') returns toggle state of CB_tuesday% --- Executes on button press in CB_wednesday.
function CB_wednesday_Callback(hObject, eventdata, handles)
% hObject    handle to CB_wednesday (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)% Hint: get(hObject,'Value') returns toggle state of CB_wednesday% --- Executes on button press in CB_thursday.
function CB_thursday_Callback(hObject, eventdata, handles)
% hObject    handle to CB_thursday (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)% Hint: get(hObject,'Value') returns toggle state of CB_thursday% --- Executes on button press in CB_friday.
function CB_friday_Callback(hObject, eventdata, handles)
% hObject    handle to CB_friday (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)% Hint: get(hObject,'Value') returns toggle state of CB_friday% --- Executes on button press in CB_saturday.
function CB_saturday_Callback(hObject, eventdata, handles)
% hObject    handle to CB_saturday (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)% Hint: get(hObject,'Value') returns toggle state of CB_saturday% --- Executes on button press in CB_sunday.
function CB_sunday_Callback(hObject, eventdata, handles)
% hObject    handle to CB_sunday (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)% Hint: get(hObject,'Value') returns toggle state of CB_sunday% --- Executes on selection change in PM_hours.
function PM_hours_Callback(hObject, eventdata, handles)
% hObject    handle to PM_hours (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 PM_hours contents as cell array
%        contents{get(hObject,'Value')} returns selected item from PM_hours% --- Executes during object creation, after setting all properties.
function PM_hours_CreateFcn(hObject, eventdata, handles)
% hObject    handle to PM_hours (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    empty - handles not created until after all CreateFcns called% Hint: popupmenu 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

三、运行结果

四、matlab版本及参考文献

1 matlab版本
2014a

2 参考文献
[1] 门云阁.MATLAB物理计算与可视化[M].清华大学出版社,2013.

【物理应用】基于matlab GUI家庭室内温湿度控制【含Matlab源码 326期】相关推荐

  1. 【光学】基于matlab GUI杨氏双缝干涉【含Matlab源码 001期】

    一.获取代码方式 获取代码方式1: 完整代码已上传我的资源:[光学]基于matlab GUI杨氏双缝干涉[含Matlab源码 001期] 点击上面蓝色字体,直接付费下载,即可. 获取代码方式2: 付费 ...

  2. 【人脸识别】基于matlab GUI人数统计【含Matlab源码 2121期】

    ⛄一.人数统计简介(附课程作业报告) 1 课题背景 本课题为基于matlab的人数统计系统.近年来,很多行业对人流信息有极大的需求,如汽车公交站,地铁站台,商场出入口等.通过人数统计系统可以方便.可靠 ...

  3. 基于SSM的仓库管理系统(含完整源码+论文)

    后端框架:SSM 数据库:MySQL 开发工具:IDEA/Eclipse 系统介绍:本系统是基于SSM框架进行设计,MySQL作为底层数据库,前端采用bootstrap 模块大致介绍:包括库存管理.出 ...

  4. 【条形码识别】基于matlab GUI二维条形码识别【含Matlab源码 607期】

    ⛄一.二维条形码识别简介 采用数字图像处理技术对二维条码进行识别, 是二维条形码识别中较常用的方法, 它在处理污损的条形码方面有光电识别方法无法比拟的优势.另外图像式识别方法对识别角度的要求没有光电识 ...

  5. 【心电信号】基于matlab GUI心电信号预处理【含Matlab源码 938期】

    ⛄一.心电信号预处理方法简介 理论知识参考文献:心电信号预处理方法研究 ⛄二.部分源代码 function varargout = kaishi(varargin) gui_Singleton = 1 ...

  6. matlab svm 语音识别,【情感识别】基于matlab支持向量机(SVM)的语音情感识别【含Matlab源码 543期】...

    一.简介 支持向量机(Support Vector Machine)是Cortes和Vapnik于1995年首先提出的,它在解决小样本.非线性及高维模式识别中表现出许多特有的优势,并能够推广应用到函数 ...

  7. 【物理应用】基于matlab GUI气象参数计算综合指标和IAQI【含Matlab源码 2116期】

    ⛄一.获取代码方式 获取代码方式1: 完整代码已上传我的资源:[物理应用]基于matlab GUI气象参数计算综合指标和IAQI[含Matlab源码 2116期] 点击上面蓝色字体,直接付费下载,即可 ...

  8. 【机械仿真】基于matlab GUI曲柄摇杆机构运动仿真【含Matlab源码 1608期】

    一.获取代码方式 获取代码方式1: 完整代码已上传我的资源:[机械仿真]基于matlab GUI曲柄摇杆机构运动仿真[含Matlab源码 1608期] 点击上面蓝色字体,直接付费下载,即可. 获取代码 ...

  9. 【运动学】基于matlab GUI三体运动模拟【含Matlab源码 871期】

    ⛄一.获取代码方式 获取代码方式1: 完整代码已上传我的资源:[运动学]基于matlab GUI三体运动模拟[含Matlab源码 871期] 点击上面蓝色字体,直接付费下载,即可. 获取代码方式2: ...

  10. 【光学】基于matlab GUI光栅条纹投影生成【含Matlab源码 2118期】

    ⛄一.获取代码方式 获取代码方式1: 完整代码已上传我的资源:[光学]基于matlab GUI光栅条纹投影生成[含Matlab源码 2118期] 点击上面蓝色字体,直接付费下载,即可. 获取代码方式2 ...

最新文章

  1. 16S+功能预测也能发Sciences:尸体降解过程中的微生物组
  2. Collection集合的三种初始化方法
  3. 【约束布局】ConstraintLayout 之 Chains 链式约束 ( Chains 简介 | 代码 及 布局分析 | 链头设置 | 间距设置 | 风格设置 | 权重设置 )
  4. optee3.14中MMU页表查询的所需配置--深入解读
  5. go语言goroutine的取消
  6. 【最详细】数据结构(C语言版 第2版)第二章课后习题答案 严蔚敏 等 编著
  7. VB winform自动更新 笔记
  8. docker知识总结
  9. Fuchsia 是什么?Fuchsia OS 的未来如何?
  10. python对数组缺失值进行填充
  11. Java list 适配器_适配器基类--万能适配器(BaseAdapter)
  12. java月亮代码_Java编程实现月食简单代码分享
  13. 华东院进入华为智慧战略 其他院怎么办
  14. 如何学好GIS,彻底领悟这几句话就够了!!!
  15. Veristand制作Custom Device全网最详细教程
  16. 即构CEO林友尧:让实时音视频技术融于无形
  17. 去哪儿网2014笔试算法题汇总
  18. 计算机控制系统在机电设备中的应用,接口技术在机电一体化控制系统中的应用...
  19. 监控白名单WMIC执行payload行为
  20. ( 保证能看懂系列)SVM系列(一)hard-margin SVM 详细原理

热门文章

  1. BZOJ 1034: [ZJOI2008]泡泡堂BNB
  2. 关于Java html table表格转excel
  3. 创建一个新数组并指定数组的长度
  4. sscanf的用法(转)
  5. java模拟http post
  6. Flash 显示全景图
  7. 探讨下Tag标签的数据库设计(千万级数据量) 转
  8. 缓冲区溢出原理及防护
  9. Attit 现代编程语言重要特性目录第一章 类型系统 基本三大类型 2第一节 字符串 数字 bool 2第二节 推断局部变量 2第三节 动态类型 2第二章 可读性与开发效率 简单性 2
  10. Atitit TPL(事务处理语言 目录 1.1. 事务隔离级别 1 1.2. Savepoint技术 1 2. Tpl 1 2.1.  打开事务 START TRANSACTION; 1 2.2.