⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 simuresultmulti.m

📁 matlab互交式进行数据统计分析的工具包。利用gui界面给方便进行基本的数据统计分析
💻 M
📖 第 1 页 / 共 3 页
字号:
            ylabel('带钢数','fontsize',9);
            title('预计算柱状图','fontsize',10,'fontweight','bold');
            grid on

            % p=capable(Temp_simu(:,1)-Temp_act,[-20 20]);
            % 1-p
            %
            % h3=figure('Menubar','none','Toolbar','figure','Numbertitle','off',...
            %     'Name','-20~20`C的概率','position',[432 49 559 182]);
            % set(gcf,'color','w')
            % subplot(121),p1=capaplot(Temp_simu(:,1)-Temp_act,[-20 20]);
            % subplot(122),p1=capaplot(Temp_pre(:,1)-Temp_act,[-20 20]);

            % 设置坐标
            n1=hist(Temp_simu(:,1)-Temp_act,t);
            n2=hist(Temp_pre(:,1)-Temp_act,t);
            if max(abs(Temp_pre(:,1)-Temp_act))<=20
                axis([handles.axes1,handles.axes2],[-20,20,0,max(max(n1),max(n2))])
            elseif max(abs(Temp_pre(:,1)-Temp_act))<=30
                axis([handles.axes1,handles.axes2],[-30,30,0,max(max(n1),max(n2))])
            elseif max(abs(Temp_pre(:,1)-Temp_act))<=40
                axis([handles.axes1,handles.axes2],[-40,40,0,max(max(n1),max(n2))])
            elseif max(abs(Temp_pre(:,1)-Temp_act))<=50
                axis([handles.axes1,handles.axes2],[-50,50,0,max(max(n1),max(n2))])
            elseif max(abs(Temp_pre(:,1)-Temp_act))<=60
                axis([handles.axes1,handles.axes2],[-60,60,0,max(max(n1),max(n2))])
            elseif max(abs(Temp_pre(:,1)-Temp_act))<=70
                axis([handles.axes1,handles.axes2],[-70,70,0,max(max(n1),max(n2))])
            else
                axis([handles.axes1,handles.axes2],[-100,100,0,max(max(n1),max(n2))])
            end

            %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
        case 2
            % 散点图
            %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
            axes(handles.axes2)
            scatter(Temp_pre(:,end),Temp_act,3,'g','filled'),hold on
%             plot([xmin,xmax],[xmin,xmax],'k',[xmin,xmax-diff1],[xmin+diff1,xmax],'k',...
%                 [xmin+diff1,xmax],[xmin,xmax-diff1],'k')
%             text((xmin-diff1+xmax)/2,(xmin+diff1+xmax)/2,['+',num2str(diff1),'℃'],'Color','k','fontweight','bold');% 温度上限
%             text((xmin+diff1+xmax)/2,(xmin-diff1+xmax)/2,['-',num2str(diff1),'℃'],'Color','k','fontweight','bold');% 温度下限
            title('预计算散点图','fontweight','bold','fontsize',10);
            xlabel('预计算 /℃','FontSize',9);
            ylabel('实际值 /℃','FontSize',9);
            hold off
            grid on
            box on
%             set(handles.axes1,'xlim',[xmin,xmax2])
%             set(handles.axes21,'ylim',[xmin,xmax2])            


            % plot on axes3
            axes(handles.axes1)
            scatter(Temp_simu(:,end),Temp_act,3,'r','filled'),hold on
%             plot([xmin,xmax],[xmin,xmax],'k',[xmin,xmax-diff2],[xmin+diff2,xmax],'k',...
%                 [xmin+diff2,xmax],[xmin,xmax-diff2],'k')
%             text((xmin-diff2+xmax)/2,(xmin+diff2+xmax)/2,['+',num2str(diff2),'℃'],'Color','k','fontweight','bold');% 温度上限
%             text((xmin+diff2+xmax)/2,(xmin-diff2+xmax)/2,['-',num2str(diff2),'℃'],'Color','k','fontweight','bold');% 温度下限
            title('仿真值散点图','fontweight','bold','fontsize',10);
            xlabel('仿真值 /℃','FontSize',9);
            ylabel('实际值 /℃','FontSize',9);
            hold off
            grid on
            box on
%             set(handles.axes3,'xlim',[xmin,xmax2])
%             set(handles.axes3,'ylim',[xmin,xmax2])
            %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

    end
end


% set(handles.figure1,'Toolbar','figure');
set(handles.uipanel1,'visible','off')
set([handles.axes1 handles.axes2],'visible','on')

set(handles.UIMenuHist,'Checked','on')
set(handles.UIMenuStat,'Checked','off')

set(handles.uipanelSimuPre,'visible','off');
set(handles.UIMenuView,'visible','on');
set(handles.uipanelRange,'visible','on');

% --- Executes on button press in btnStat.
function pushbutton6_Callback(hObject, eventdata, handles)
% hObject    handle to btnStat (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)




% --------------------------------------------------------------------
function Untitled_2_Callback(hObject, eventdata, handles)
% hObject    handle to Untitled_2 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)


% --------------------------------------------------------------------
function UIMenuStat_Callback(hObject, eventdata, handles)
% hObject    handle to UIMenuStat (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)


% --------------------------------------------------------------------
function UIMenuHist_Callback(hObject, eventdata, handles)
% hObject    handle to UIMenuHist (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)


% --------------------------------------------------------------------
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)


% --------------------------------------------------------------------
function Untitled_3_Callback(hObject, eventdata, handles)
% hObject    handle to Untitled_3 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)




% --------------------------------------------------------------------
function UIMenuProp_Callback(hObject, eventdata, handles)
% hObject    handle to UIMenuProp (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
propertyeditor(handles.figure1,'on')


% --------------------------------------------------------------------
function UIMenuView_Callback(hObject, eventdata, handles)
% hObject    handle to UIMenuView (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)





function editXLimA_Callback(hObject, eventdata, handles)
% hObject    handle to editXLimA (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 editXLimA as text
%        str2double(get(hObject,'String')) returns contents of editXLimA as a double
a=str2num(get(handles.editXLimA,'string'));
b=str2num(get(handles.editXLimB,'string'));

set([handles.axes1 handles.axes2],'Xlim',[a b]);

% --- Executes during object creation, after setting all properties.
function editXLimA_CreateFcn(hObject, eventdata, handles)
% hObject    handle to editXLimA (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



function editXlimB_Callback(hObject, eventdata, handles)
% hObject    handle to editXlimB (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 editXlimB as text
%        str2double(get(hObject,'String')) returns contents of editXlimB as a double


% --- Executes during object creation, after setting all properties.
function editXlimB_CreateFcn(hObject, eventdata, handles)
% hObject    handle to editXlimB (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





function editXLimB_Callback(hObject, eventdata, handles)
% hObject    handle to editXLimB (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 editXLimB as text
%        str2double(get(hObject,'String')) returns contents of editXLimB as a double
a=str2num(get(handles.editXLimA,'string'));
b=str2num(get(handles.editXLimB,'string'));

set([handles.axes1 handles.axes2],'Xlim',[a b]);


% --- Executes during object creation, after setting all properties.
function editXLimB_CreateFcn(hObject, eventdata, handles)
% hObject    handle to editXLimB (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




% --------------------------------------------------------------------
function uipanelSimuPre_SelectionChangeFcn(hObject, eventdata, handles)
% hObject    handle to uipanelSimuPre (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
Sresult=evalin('base','Sresult');
Temp_simu=Sresult.Temp_simu;
Temp_act=Sresult.Temp_act;
Temp_pre=Sresult.Temp_pre;

switch get(hObject,'Tag')
    case 'radiobutton1'
        Sresult.minSimu=min(Temp_simu(:,1));
        Sresult.maxSimu=max(Temp_simu(:,1));
        Sresult.meanSimu=mean(Temp_simu(:,1));
        Sresult.stdSimu=std(Temp_simu(:,1));

        Sresult.minAct=min(Temp_act(:,1));
        Sresult.maxAct=max(Temp_act(:,1));
        Sresult.meanAct=mean(Temp_act(:,1));
        Sresult.stdAct=std(Temp_act(:,1));

        Sresult.maxAbsError=max(abs(Temp_act(:,1)-Temp_simu(:,1)));
        Sresult.maxRelError=100*max(abs(Temp_act(:,1)-Temp_simu(:,1))./Temp_act(:,1));
        Sresult.mse=sqrt(mse(Temp_act(:,1)-Temp_simu(:,1)));
        %     Sresult.mse=sqrt((Temp_act(:,1)-Temp_simu(:,1))'*(Temp_act(:,1)-Temp_simu(:,1))/Sresult.N);
        Sresult.mae=mae(Temp_act(:,1)-Temp_simu(:,1));

        % 仿真模型的统计结果
        %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
        set(handles.editMinSimu,'String',num2str(Sresult.minSimu));
        set(handles.editMaxSimu,'String',num2str(Sresult.maxSimu));
        set(handles.editMeanSimu,'String',num2str(Sresult.meanSimu));
        set(handles.editStdSimu,'String',num2str(Sresult.stdSimu));

        set(handles.editMinAct,'String',num2str(Sresult.minAct));
        set(handles.editMaxAct,'String',num2str(Sresult.maxAct));
        set(handles.editMeanAct,'String',num2str(Sresult.meanAct));
        set(handles.editStdAct,'String',num2str(Sresult.stdAct));

        set(handles.editMaxAbsError,'String',num2str(Sresult.maxAbsError));
        set(handles.editMaxRelError,'String',num2str(Sresult.maxRelError));
        set(handles.editMSE,'String',num2str(Sresult.mse));
        set(handles.editMAE,'String',num2str(Sresult.mae));
        %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
        
        
    case 'radiobutton2'
        Sresult.minSimu=min(Temp_pre(:,1));
        Sresult.maxSimu=max(Temp_pre(:,1));
        Sresult.meanSimu=mean(Temp_pre(:,1));
        Sresult.stdSimu=std(Temp_pre(:,1));

        Sresult.minAct=min(Temp_act(:,1));
        Sresult.maxAct=max(Temp_act(:,1));
        Sresult.meanAct=mean(Temp_act(:,1));
        Sresult.stdAct=std(Temp_act(:,1));

        Sresult.maxAbsError=max(abs(Temp_act(:,1)-Temp_pre(:,1)));
        Sresult.maxRelError=100*max(abs(Temp_act(:,1)-Temp_pre(:,1))./Temp_act(:,1));
        Sresult.mse=sqrt(mse(Temp_act(:,1)-Temp_pre(:,1)));
        %     Sresult.mse=sqrt((Temp_act(:,1)-Temp_pre(:,1))'*(Temp_act(:,1)-Temp_pre(:,1))/Sresult.N);
        Sresult.mae=mae(Temp_act(:,1)-Temp_pre(:,1));

        % 预计算模型的统计结果
        %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
        set(handles.editMinSimu,'String',num2str(Sresult.minSimu));
        set(handles.editMaxSimu,'String',num2str(Sresult.maxSimu));
        set(handles.editMeanSimu,'String',num2str(Sresult.meanSimu));
        set(handles.editStdSimu,'String',num2str(Sresult.stdSimu));

        set(handles.editMinAct,'String',num2str(Sresult.minAct));
        set(handles.editMaxAct,'String',num2str(Sresult.maxAct));
        set(handles.editMeanAct,'String',num2str(Sresult.meanAct));
        set(handles.editStdAct,'String',num2str(Sresult.stdAct));

        set(handles.editMaxAbsError,'String',num2str(Sresult.maxAbsError));
        set(handles.editMaxRelError,'String',num2str(Sresult.maxRelError));
        set(handles.editMSE,'String',num2str(Sresult.mse));
        set(handles.editMAE,'String',num2str(Sresult.mae));
        %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
end


% --- Executes on button press in pushbutton7.
function pushbutton7_Callback(hObject, eventdata, handles)
% hObject    handle to pushbutton7 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)


⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -