function varargout = jiaotongyuce(varargin)
% JIAOTONGYUCE MATLAB code for jiaotongyuce.fig
% JIAOTONGYUCE, by itself, creates a new JIAOTONGYUCE or raises the existing
% singleton*.
%
% H = JIAOTONGYUCE returns the handle to a new JIAOTONGYUCE or the handle to
% the existing singleton*.
%
% JIAOTONGYUCE('CALLBACK',hObject,eventData,handles,...) calls the local
% function named CALLBACK in JIAOTONGYUCE.M with the given input arguments.
%
% JIAOTONGYUCE('Property','Value',...) creates a new JIAOTONGYUCE or raises the
% existing singleton*. Starting from the left, property value pairs are
% applied to the GUI before jiaotongyuce_OpeningFcn gets called. An
% unrecognized property name or invalid value makes property application
% stop. All inputs are passed to jiaotongyuce_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 jiaotongyuce
% Last Modified by GUIDE v2.5 30-Mar-2020 00:06:37
% Begin initialization code - DO NOT EDIT
gui_Singleton = 1;
gui_State = struct('gui_Name', mfilename, ...
'gui_Singleton', gui_Singleton, ...
'gui_OpeningFcn', @jiaotongyuce_OpeningFcn, ...
'gui_OutputFcn', @jiaotongyuce_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 just before jiaotongyuce is made visible.
function jiaotongyuce_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 jiaotongyuce (see VARARGIN)
% Choose default command line output for jiaotongyuce
handles.output = hObject;
% Update handles structure
guidata(hObject, handles);
% UIWAIT makes jiaotongyuce wait for user response (see UIRESUME)
% uiwait(handles.figure1);
% --- Outputs from this function are returned to the command line.
function varargout = jiaotongyuce_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;
% --- Executes on selection change in listbox1.
function listbox1_Callback(hObject, eventdata, handles)
% hObject handle to listbox1 (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 listbox1 contents as cell array
% contents{get(hObject,'Value')} returns selected item from listbox1
% --- Executes during object creation, after setting all properties.
function listbox1_CreateFcn(hObject, eventdata, handles)
% hObject handle to listbox1 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns called
% Hint: listbox 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 selection change in listbox2.
function listbox2_Callback(hObject, eventdata, handles)
% hObject handle to listbox2 (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 listbox2 contents as cell array
% contents{get(hObject,'Value')} returns selected item from listbox2
% --- Executes during object creation, after setting all properties.
function listbox2_CreateFcn(hObject, eventdata, handles)
% hObject handle to listbox2 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns called
% Hint: listbox 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 pushbutton1.
function pushbutton1_Callback(hObject, eventdata, handles)
% hObject handle to pushbutton1 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
%% 灰度预测
t1=handles.t1;
t2=handles.t2;
syms a b;
c=[a b]';
A=handles.A;%2008-2014数据
A1=handles.A1;%
NN=str2double(get(handles.edit3,'String'));%获取预测年数
T3=min(t1):max(t1)+NN;%预测时间序列
%% 灰度预测
B=cumsum(A); % 原始数据累加
n=length(A);%获取长度
for i=1:(n-1)
C(i)=(B(i)+B(i+1))/2; % 生成累加矩阵
end
% 计算待定参数的值
D=A;D(1)=[];
D=D';
E=[-C;ones(1,n-1)];
c=inv(E*E')*E*D;
c=c';
a=c(1);b=c(2);
% 预测后续数据
F=[];F(1)=A(1);
for i=2:(n+NN)
F(i)=(A(1)-b/a)/exp(a*(i-1))+b/a ;
end
G=[];G_huidu(1)=A(1);
for i=2:(n+NN)
G_huidu(i)=F(i)-F(i-1); %得到预测出来的数据
end
S(1)=std(G_huidu);%标准差
format short
[wucha1,wucha2]=mse(G_huidu(8:9),A1(8:9));
wucha1=roundn(wucha1,-2);
wucha2=roundn(wucha2,-4);
set(handles.text1,'String',['均值方差=',num2str(wucha1)]);
set(handles.text3,'String',['百分绝对方差=',num2str(wucha2*100),'%']);
str1=[];
str2=[];
for i=1:n+NN
str1=[str1,num2str(T3(i)),10];
str2=[str2,num2str(G_huidu(i)),10];
end
set(handles.edit1,'String',str1);
set(handles.edit2,'String',str2);
plot(t1,A,'ro',T3,G_huidu,'b*') %原始数据与预测数据的比较
xlabel('年份')
ylabel('客流量');
legend('实际值','灰度预测值')
handles.G_huidu=G_huidu;
handles.S(1)=S(1);
guidata(hObject,handles);
% --- Executes on button press in pushbutton2.
function pushbutton2_Callback(hObject, eventdata, handles)
% hObject handle to pushbutton2 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
%% %% 回归预测
t1=handles.t1;
t2=handles.t2;
A=handles.A;
A1=handles.A1;
n=length(A);
NN=str2double(get(handles.edit3,'String'));%获取预测年数
T3=min(t1):max(t1)+NN;%预测时间序列
p=polyfit(t1,A,2);
G_huigui=polyval(p,T3);
S(2)=std(G_huigui);%标准差
format short
[wucha1,wucha2]=mse(G_huigui(8:9),A1(8:9));
wucha1=roundn(wucha1,-2);
wucha2=roundn(wucha2,-4);
set(handles.text1,'String',['均值方差=',num2str(wucha1)]);
set(handles.text3,'String',['百分绝对方差=',num2str(wucha2*100),'%']);
str1=[];
str2=[];
for i=1:n+NN
str1=[str1,num2str(T3(i)),10];
str2=[str2,num2str(G_huigui(i)),10];
end
set(handles.edit1,'String',str1);
set(handles.edit2,'String',str2);
plot(t1,A,'ro',T3,G_huigui,'g*') %原始数据与预测数据的比较
xlabel('年份')
ylabel('客流量');
legend('实际值','回归分析法预测值')
handles.G_huigui=G_huigui;
handles.S(2)=S(2);
guidata(hObject,handles);
% --- Executes on button press in pushbutton3.
function pushbutton3_Callback(hObject, eventdata, handles)
% hObject handle to pushbutton3 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
%% 二次指数平滑
t1=handles.t1;
t2=handles.t2;
A=handles.A;
A1=handles.A1;
NN=str2double(get(handles.edit3,'String'));%获取预测年数
T3=min(t1):max(t1)+NN;%预测时间序列
alpha=0.13;
%%
yt=A;
n=length(yt);%yt???????????
st1
没有合适的资源?快使用搜索试试~ 我知道了~
【运输量预测】基于matlab多种算法公路运输量预测【含Matlab源码 041期】.zip
共5个文件
m:2个
jpg:1个
xls:1个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
5星 · 超过95%的资源 1 下载量 171 浏览量
2021-11-24
20:53:06
上传
评论 2
收藏 92KB ZIP 举报
温馨提示
CSDN海神之光上传的全部代码均可运行,亲测可用,直接替换数据即可,适合小白; 1、代码压缩包内容 主函数:jiaotongyuce.m; 数据; fig文件:GUI界面;无需运行 运行结果效果图; 2、代码运行版本 Matlab 2019b;若运行有误,根据提示修改;若不会,可私信博主; 3、运行操作步骤 步骤一:将所有文件放到Matlab的当前文件夹中; 步骤二:双击打开除jiaotongyuce.m的其他m文件; 步骤三:点击运行,等程序运行完得到结果; 4、仿真咨询 如需其他服务,可私信博主或扫描博主博客文章底部QQ名片; 4.1 CSDN博客或资源的完整代码提供 4.2 期刊或参考文献复现 4.3 Matlab程序定制 4.4 科研合作 公路运输量预测系列程序定制或科研合作方向:
资源推荐
资源详情
资源评论
收起资源包目录
【运输量预测】基于matlab多种算法公路运输量预测【含Matlab源码 041期】.zip (5个子文件)
【运输量预测】基于matlab多种算法公路运输量预测【含Matlab源码 041期】
运行结果.JPG 111KB
data.xls 19KB
jiaotongyuce.fig 8KB
jiaotongyuce.m 15KB
mse.m 220B
共 5 条
- 1
资源评论
- 「已注销」2022-05-07用户下载后在一定时间内未进行评价,系统默认好评。
海神之光
- 粉丝: 3w+
- 资源: 2093
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功