网站首页 > 技术文章 正文
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控件轻松实现二维码标签批量打印
- 08-06中等生如何学好初二数学函数篇
- 08-06C#构造函数
- 08-06初中数学:一次函数学习要点和方法
- 08-06仓颉编程语言基础-数据类型—结构类型
- 08-06C++实现委托机制
- 08-06初中VS高中三角函数:从"固定镜头"到"360°全景",数学视野升级
- 08-06一文讲透PLC中Static和Temp变量的区别
- 08-06类三剑客:一招修改所有对象!类方法与静态方法的核心区别!
- 最近发表
- 标签列表
-
- cmd/c (90)
- c++中::是什么意思 (84)
- 标签用于 (71)
- 主键只能有一个吗 (77)
- c#console.writeline不显示 (95)
- pythoncase语句 (88)
- es6includes (74)
- sqlset (76)
- windowsscripthost (69)
- apt-getinstall-y (100)
- node_modules怎么生成 (87)
- chromepost (71)
- flexdirection (73)
- c++int转char (80)
- mysqlany_value (79)
- static函数和普通函数 (84)
- el-date-picker开始日期早于结束日期 (70)
- asynccallback (71)
- localstorage.removeitem (74)
- vector线程安全吗 (70)
- java (73)
- js数组插入 (83)
- mac安装java (72)
- 查看mysql是否启动 (70)
- 无效的列索引 (74)