网站首页 > 技术文章 正文
BP(BackPropagation)神经网络可用于数据的预测,是经常使用的预测方法之一。之前介绍了基于MATLAB的guide制作的BP神经网络预测计算GUI界面,但是随着MATLAB版本的更新,之后的版本不再支持guide制作的GUI界面,因此我基于MATLAB App Designer将BP神经网络预测计算GUI界面修改成App,这样可以兼容2016之后的版本,也不受最新版本的限制。
基于MATLAB的BP神经网络预测计算APP的运行界面如下:
点击加载数据——输入样本数据个数、训练数据个数、预测数据个数、中间层隐藏节点个数、网络输入维度、网络输出维度,x轴坐标名称、y轴坐标名称——点击开始计算即可出现结果,同时会在当前文件夹下生成预测数据的excel文件和相应图片bmp、fig、jpg和pdf格式文件。需要基于MATLAB的BP神经网络预测计算APP的完整程序,可以进行打赏后截图(50元及以上),点击微信公众号云龙派的“联系掌门”按键进行联系,或者在微信公众号云龙派里内回复截图,几小时内会回复。界面编程不易,还请见谅!App Designer编程不易,还请见谅!
1.基于MATLAB的BP神经网络预测计算APP举例计算
样本数据
Step1:点击BpyuceApp.mlappinstall文件,在MATLAB中双击安装APP,点击安装到我的APP。
Step2:在APP 菜单栏中找到我的app中的BpyuceApp,双击运行出App主界面。
Step3:点击加载数据,选择数据excel文件,并点击确定。
Step4:输入参数。
Step5:点击开始计算。
Step6:运行结果文件生成。
2.App主要程序如下
classdef Bpyuceapp < matlab.apps.AppBase
% Properties that correspond to app components
properties (Access = public)
UIFigure matlab.ui.Figure
BpPanel matlab.ui.container.Panel
Panel matlab.ui.container.Panel
Button matlab.ui.control.Button
Label_3 matlab.ui.control.Label
EditField matlab.ui.control.NumericEditField
Label_4 matlab.ui.control.Label
EditField_2 matlab.ui.control.NumericEditField
Label_5 matlab.ui.control.Label
EditField_3 matlab.ui.control.NumericEditField
Label_6 matlab.ui.control.Label
EditField_4 matlab.ui.control.NumericEditField
Label_7 matlab.ui.control.Label
EditField_5 matlab.ui.control.NumericEditField
Label_8 matlab.ui.control.Label
EditField_6 matlab.ui.control.NumericEditField
xEditFieldLabel matlab.ui.control.Label
xEditField matlab.ui.control.EditField
yEditFieldLabel matlab.ui.control.Label
yEditField matlab.ui.control.EditField
Panel_2 matlab.ui.container.Panel
Button_2 matlab.ui.control.Button
Button_3 matlab.ui.control.Button
Button_4 matlab.ui.control.Button
Panel_3 matlab.ui.container.Panel
UIAxes matlab.ui.control.UIAxes
UIAxes_2 matlab.ui.control.UIAxes
UITable matlab.ui.control.Table
UITable_2 matlab.ui.control.Table
UITable_3 matlab.ui.control.Table
Label matlab.ui.control.Label
BpLabel matlab.ui.control.Label
Label_2 matlab.ui.control.Label
end
% Callbacks that handle component events
methods (Access = private)
% Button pushed function: Button_4
function Button_4Pushed(app, event)
closereq;
end
% Button pushed function: Button_3
function Button_3Pushed(app, event)
app.EditField.Value = 0;
app.EditField_2.Value = 0;
app.EditField_3.Value = 0;
app.EditField_4.Value = 0;
app.EditField_5.Value = 0;
app.EditField_6.Value = 0;
app.xEditField.Value = " ";
app.yEditField.Value = " ";
app.UITable.Data = [];%矩阵数据使表格为空
app.UITable_2.Data = [];
app.UITable_3.Data = [];
try
delete(allchild(app.UIAxes));
delete(allchild(app.UIAxes_2));
end
end
% Button pushed function: Button
function ButtonPushed(app, event)
%加载数据 使用全局变量传递加载的数据
global data
[filename,pathname,filterindex]=uigetfile({'*.xlsx';'*.txt';'*.*'},'打开数据');
if ~filename
return;
end
str1=[pathname,filename];
if (filename==0 & pathname==0)
msgbox('您没有选择文件,请重新选择!','打开文件出错','error');
else
% data=xlsread (strcat([pathname filename])); %strcat是组成路径的。
data = xlsread (strcat([pathname filename]));
msgbox('打开及读取数据完毕!','确认','warn');
end
end
本文内容来源于网络,仅供参考学习,如内容、图片有任何版权问题,请联系处理,24小时内删除。
作 者 | 郭志龙
编 辑 | 郭志龙
校 对 | 郭志龙
猜你喜欢
- 2025-06-13 1分钟,彻底弄懂浏览器缓存策略(浏览器缓存概念)
- 2025-06-13 Go 学习:从环境搭建到写一个 Web 服务
- 2025-06-13 苹果四大系统信息汇总(苹果系统包括哪些手机)
- 2025-06-13 90%企业都适用,搭建性能监控体系照抄就行
- 2025-06-13 Excel常用技能分享与探讨(5-宏与VBA简介 VBA之用户窗体-多页控件)
- 2025-06-13 电脑常用组合键大全:指尖上的效率革命
- 2025-06-13 体验iOS 15之后,我记住了这8个小细节
- 2025-06-13 AI绘画EasyControl来了,宫崎骏「吉卜力」画风开源免费使用
- 2025-06-13 基于MATLAB的Malthus人口预测模型计算App
- 2025-06-13 Excel神器!用Barcode控件轻松实现二维码标签批量打印
- 06-13C++之类和对象(c++中类和对象的区别)
- 06-13C语言进阶教程:数据结构 - 哈希表的基本原理与实现
- 06-13C语言实现见缝插圆游戏!零基础代码思路+源码分享
- 06-13Windows 10下使用编译并使用openCV
- 06-13C语言进阶教程:栈和队列的实现与应用
- 06-13C语言这些常见标准文件该如何使用?很基础也很重要
- 06-13C语言 vs C++:谁才是编程界的“全能王者”?
- 06-13C语言无锁编程指南(c语言锁机代码)
- 最近发表
- 标签列表
-
- cmd/c (64)
- c++中::是什么意思 (83)
- 标签用于 (65)
- 主键只能有一个吗 (66)
- c#console.writeline不显示 (75)
- pythoncase语句 (81)
- es6includes (73)
- sqlset (64)
- windowsscripthost (67)
- apt-getinstall-y (86)
- node_modules怎么生成 (76)
- chromepost (65)
- c++int转char (75)
- static函数和普通函数 (76)
- el-date-picker开始日期早于结束日期 (70)
- localstorage.removeitem (74)
- vector线程安全吗 (70)
- & (66)
- java (73)
- js数组插入 (83)
- linux删除一个文件夹 (65)
- mac安装java (72)
- eacces (67)
- 查看mysql是否启动 (70)
- 无效的列索引 (74)