2 Star 16 Fork 1

snowland.ltd/snowland-FCE

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
snowland_ThreeRatioMethod.m 9.49 KB
一键复制 编辑 原始数据 按行查看 历史
A.Star 提交于 2018-03-22 13:47 . 图形界面
function varargout = snowland_ThreeRatioMethod(varargin)
% SNOWLAND_THREERATIOMETHOD MATLAB code for snowland_ThreeRatioMethod.fig
% SNOWLAND_THREERATIOMETHOD, by itself, creates a new SNOWLAND_THREERATIOMETHOD or raises the existing
% singleton*.
%
% H = SNOWLAND_THREERATIOMETHOD returns the handle to a new SNOWLAND_THREERATIOMETHOD or the handle to
% the existing singleton*.
%
% SNOWLAND_THREERATIOMETHOD('CALLBACK',hObject,eventData,handles,...) calls the local
% function named CALLBACK in SNOWLAND_THREERATIOMETHOD.M with the given input arguments.
%
% SNOWLAND_THREERATIOMETHOD('Property','Value',...) creates a new SNOWLAND_THREERATIOMETHOD or raises the
% existing singleton*. Starting from the left, property value pairs are
% applied to the GUI before snowland_ThreeRatioMethod_OpeningFcn gets called. An
% unrecognized property name or invalid value makes property application
% stop. All inputs are passed to snowland_ThreeRatioMethod_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 snowland_ThreeRatioMethod
% Last Modified by GUIDE v2.5 22-Mar-2018 13:33:48
% Begin initialization code - DO NOT EDIT
gui_Singleton = 1;
gui_State = struct('gui_Name', mfilename, ...
'gui_Singleton', gui_Singleton, ...
'gui_OpeningFcn', @snowland_ThreeRatioMethod_OpeningFcn, ...
'gui_OutputFcn', @snowland_ThreeRatioMethod_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 snowland_ThreeRatioMethod is made visible.
function snowland_ThreeRatioMethod_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 snowland_ThreeRatioMethod (see VARARGIN)
% Choose default command line output for snowland_ThreeRatioMethod
handles.output = hObject;
% Update handles structure
guidata(hObject, handles);
% UIWAIT makes snowland_ThreeRatioMethod wait for user response (see UIRESUME)
% uiwait(handles.figure1);
% --- Outputs from this function are returned to the command line.
function varargout = snowland_ThreeRatioMethod_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 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)
data = repmat([20,8.1,4.9,37.5,1.9],100,1);%
delta = [100,100,100,100,100];% ¸
color = ['r','g','b','y','k'];
while 1
for i = 1 : 5
plot(data(:,i),color(i))
hold on
end
r = rand([1,5])*2-1;
newdata = data(end,:) + delta.*r;
data = [data(2:end,:);newdata];
data(data<=0) = 0;
pause(0.5)
hold off
c2h2 = newdata(1);
c2h4 = newdata(2);
ch4 = newdata(3);
h2 = newdata(4);
c2h6 = newdata(5);
set(handles.edit1,'string', num2str(c2h2))
set(handles.edit2,'string', num2str(c2h4))
set(handles.edit3,'string', num2str(ch4))
set(handles.edit4,'string', num2str(h2))
set(handles.edit5,'string', num2str(c2h6))
% c2h2 = str2double(get(handles.edit1,'string'));
% c2h4 = str2double(get(handles.edit2,'string'));
% ch4 = str2double(get(handles.edit3,'string'));
% h2 = str2double(get(handles.edit4,'string'));
% c2h6 = str2double(get(handles.edit5,'string'));
set(handles.text9, 'string', num2str(c2h2/c2h4));
set(handles.text10, 'string', num2str(ch4/h2));
set(handles.text11, 'string', num2str(c2h4/c2h6));
c1 = getCode(c2h2/c2h4,1);
c2 = getCode(ch4/h2,2);
c3 = getCode(c2h4/c2h6,3);
set(handles.text12, 'string', c1);
set(handles.text13, 'string', c2);
set(handles.text14, 'string', c3);
codes = [c1,c2,c3];
set(handles.text16, 'string', getReason(codes));
end
function edit1_Callback(hObject, eventdata, handles)
% hObject handle to edit1 (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 edit1 as text
% str2double(get(hObject,'String')) returns contents of edit1 as a double
% --- Executes during object creation, after setting all properties.
function edit1_CreateFcn(hObject, eventdata, handles)
% hObject handle to edit1 (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 edit2_Callback(hObject, eventdata, handles)
% hObject handle to edit2 (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 edit2 as text
% str2double(get(hObject,'String')) returns contents of edit2 as a double
% --- Executes during object creation, after setting all properties.
function edit2_CreateFcn(hObject, eventdata, handles)
% hObject handle to edit2 (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 edit3_Callback(hObject, eventdata, handles)
% hObject handle to edit3 (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 edit3 as text
% str2double(get(hObject,'String')) returns contents of edit3 as a double
% --- Executes during object creation, after setting all properties.
function edit3_CreateFcn(hObject, eventdata, handles)
% hObject handle to edit3 (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 edit4_Callback(hObject, eventdata, handles)
% hObject handle to edit4 (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 edit4 as text
% str2double(get(hObject,'String')) returns contents of edit4 as a double
% --- Executes during object creation, after setting all properties.
function edit4_CreateFcn(hObject, eventdata, handles)
% hObject handle to edit4 (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 edit5_Callback(hObject, eventdata, handles)
% hObject handle to edit5 (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 edit5 as text
% str2double(get(hObject,'String')) returns contents of edit5 as a double
% --- Executes during object creation, after setting all properties.
function edit5_CreateFcn(hObject, eventdata, handles)
% hObject handle to edit5 (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 during object creation, after setting all properties.
function axes1_CreateFcn(hObject, eventdata, handles)
% hObject handle to axes1 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns called
% Hint: place code in OpeningFcn to populate axes1
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Matlab
1
https://gitee.com/snowlandltd/snowland-FCE.git
git@gitee.com:snowlandltd/snowland-FCE.git
snowlandltd
snowland-FCE
snowland-FCE
master

搜索帮助