📄 jfk4123.m
字号:
function varargout = jfk3(varargin)
% JFK3 M-file for jfk3.fig
% JFK3, by itself, creates a new JFK3 or raises the existing
% singleton*.
%
% H = JFK3 returns the handle to a new JFK3 or the handle to
% the existing singleton*.
%
% JFK3('CALLBACK',hObject,eventData,handles,...) calls the local
% function named CALLBACK in JFK3.M with the given input arguments.
%
% JFK3('Property','Value',...) creates a new JFK3 or raises the
% existing singleton*. Starting from the left, property value pairs are
% applied to the GUI before jfk3_OpeningFunction gets called. An
% unrecognized property name or invalid value makes property application
% stop. All inputs are passed to jfk3_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 jfk3
% Last Modified by GUIDE v2.5 10-Jun-2005 21:12:59
% Begin initialization code - DO NOT EDIT
gui_Singleton = 1;
gui_State = struct('gui_Name', mfilename, ...
'gui_Singleton', gui_Singleton, ...
'gui_OpeningFcn', @jfk3_OpeningFcn, ...
'gui_OutputFcn', @jfk3_OutputFcn, ...
'gui_LayoutFcn', [] , ...
'gui_Callback', []);
if nargin & isstr(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 jfk3 is made visible.
function jfk3_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 jfk3 (see VARARGIN)
% Choose default command line output for jfk3
handles.output = hObject;
% Update handles structure
guidata(hObject, handles);
% UIWAIT makes jfk3 wait for user response (see UIRESUME)
% uiwait(handles.figure1);
% --- Outputs from this function are returned to the command line.
function varargout = jfk3_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 push1.function push1_Callback(hObject, eventdata, handles)% hObject handle to push1 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)kl=get(handles.slider1,'Value');
t=0:0.01:pi*2;
z=(cos(kl*pi.*cos(t))-cos(kl*pi))./sin(t).*sign(t-pi);
[y,x]=pol2cart(t,z);
axes(handles.axes1)
plot(x,y,'*')
set(handles.edit1,'string',num2str(kl));
% --- 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)kl=get(handles.slider1,'Value');i=1
t=0:0.01:pi*2;
z=(cos(kl*pi.*cos(t))-cos(kl*pi))./sin(t).*sign(t-pi);
h=plot3(t,z.*sin(t(i)),z.*cos(t(i)),'*','erasemode','none');
axes(handles.axes1)
grid on;
axis([0 2*pi -3 3 -3 3]);
view([0 90])
for i=2:length(t)
set(h,'xdata',t,'ydata',z.*sin(t(i)),'zdata',z.*cos(t(i)))
drawnow;pause(0.2)
end
% --- Executes on button press in push3.function push3_Callback(hObject, eventdata, handles)% hObject handle to push3 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)close;% --- 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 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% --- 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'));endfunction 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 when figure1 window is resized.function figure1_ResizeFcn(hObject, eventdata, handles)% hObject handle to figure1 (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 + -