function varargout = untitled3(varargin)
% UNTITLED3 M-file for untitled3.fig
% UNTITLED3, by itself, creates a new UNTITLED3 or raises the existing
% singleton*.
%
% H = UNTITLED3 returns the handle to a new UNTITLED3 or the handle to
% the existing singleton*.
%
% UNTITLED3('CALLBACK',hObject,eventData,handles,...) calls the local
% function named CALLBACK in UNTITLED3.M with the given input arguments.
%
% UNTITLED3('Property','Value',...) creates a new UNTITLED3 or raises the
% existing singleton*. Starting from the left, property value pairs are
% applied to the GUI before untitled3_OpeningFunction gets called. An
% unrecognized property name or invalid value makes property application
% stop. All inputs are passed to untitled3_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
% Copyright 2002-2003 The MathWorks, Inc.
% Edit the above text to modify the response to help untitled3
% Last Modified by GUIDE v2.5 03-May-2010 16:11:11
% Begin initialization code - DO NOT EDIT
gui_Singleton = 1;
gui_State = struct('gui_Name', mfilename, ...
'gui_Singleton', gui_Singleton, ...
'gui_OpeningFcn', @untitled3_OpeningFcn, ...
'gui_OutputFcn', @untitled3_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 untitled3 is made visible.
function untitled3_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 untitled3 (see VARARGIN)
% Choose default command line output for untitled3
handles.output = hObject;
% Update handles structure
guidata(hObject, handles);
% UIWAIT makes untitled3 wait for user response (see UIRESUME)
% uiwait(handles.figure1);
% --- Outputs from this function are returned to the command line.
function varargout = untitled3_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;
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
Current_Str=get(hObject,'String');
Current_Val=str2double(Current_Str);
set(handles.slider1,'Value',Current_Val);
global A;
A=Current_Val;
% --- 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
set(hObject,'BackgroundColor','white');
else
set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor'));
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
Current_Str=get(hObject,'String');
Current_Val=str2double(Current_Str);
set(handles.slider2,'Value',Current_Val);
global frq;
frq=Current_Val;
% --- 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
set(hObject,'BackgroundColor','white');
else
set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor'));
end
% --- Executes on slider movement.
function slider1_Callback(hObject, eventdata, handles)
% hObject handle to slider1 (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,'Value') returns position of slider
% get(hObject,'Min') and get(hObject,'Max') to determine range of slider
%Value=get(hObject,'Value');
%set(handles.edit1,'String',Value)
data = guidata(gcbo); % get the struct, use the handles:
set(data.edit1, 'String',...
num2str(get(data.slider1, 'Value')));
data = guidata(gcbo); % need handles, may need error info
val = str2double(get(data.edit1,'String'));
if isnumeric(val) & length(val)==1 & ...
val >= get(data.slider1, 'Min') & ...
val <= get(data.slider1, 'Max')
set(data.slider1, 'Value', val);
else
% increment the error count, and display it
data.numberOfErrors = data.numberOfErrors + 1;
set(handles.valueEdit1, 'String',...
[ data.errorString, num2str(data.numberOfErrors) ]);
guidata(gcbo, data);% store the changes...
end
global A;
A=val;
% --- Executes during object creation, after setting all properties.
function slider1_CreateFcn(hObject, eventdata, handles)
% hObject handle to slider1 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns called
% Hint: slider controls usually have a light gray background, change
% 'usewhitebg' to 0 to use default. See ISPC and COMPUTER.
usewhitebg = 1;
if usewhitebg
set(hObject,'BackgroundColor',[.9 .9 .9]);
else
set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor'));
end
% --- Executes on slider movement.
function slider2_Callback(hObject, eventdata, handles)
% hObject handle to slider2 (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,'Value') returns position of slider
% get(hObject,'Min') and get(hObject,'Max') to determine range of slider
%Value=get(hObject,'Value');
%set(handles.edit2,'String',Value)
data = guidata(gcbo); % get the struct, use the handles:
set(data.edit2, 'String',...
num2str(get(data.slider2, 'Value')));
data = guidata(gcbo); % need handles, may need error info
val = str2double(get(data.edit2,'String'));
if isnumeric(val) & length(val)==1 & ...
val >= get(data.slider2, 'Min') & ...
val <= get(data.slider2, 'Max')
set(data.slider2, 'Value', val);
else
% increment the error count, and display it
data.numberOfErrors = data.numberOfErrors + 1;
set(handles.edit2, 'String',...
[
wouderw
- 粉丝: 344
- 资源: 2959
最新资源
- 消息队列技术综述.pdf
- 一种基于Wi-Fi的室内定 位算法研究与实现.pdf
- 随机森林算法在心音分类中的应用研究.pdf
- 基于两种二维连续小波变换的奇异性检测方法研究.pdf
- 一种双频双模 式涡旋微带阵列天线的设计.pdf
- 基于项目的三支决策推荐系统.pdf
- 射电望远镜指向误差提取及其容错修正分析.pdf
- 单轴混排微型涡扇发动机低转速动力学建模.pdf
- 基于AMESim的不同充电方式下磷酸铁锂电池老化仿 真分析.pdf
- 基于动态网络图和泛洪算法的联合投送问题建模与优化.pdf
- 碎纸片拼接复原模型.pdf
- 安全用电卫士.pdf
- 一种更快捷的轻量级人脸识别模型.pdf
- 基于交替方向乘子法的球磨机负荷分布式随机权值神经网络模型.pdf
- Ipv6中利用汇聚数据流实现QoS的新机制.pdf
- 基于全局特征的极光图像分类.pdf
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
评论0