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

📄 jfk.asv

📁 电磁辐射的数值分析与仿真(基于MATLAB语言)。包括两个点电荷的电场
💻 ASV
字号:
function varargout = jfk(varargin)
% JFK M-file for jfk.fig
%      JFK, by itself, creates a new JFK or raises the existing
%      singleton*.
%
%      H = JFK returns the handle to a new JFK or the handle to
%      the existing singleton*.
%
%      JFK('CALLBACK',hObject,eventData,handles,...) calls the local
%      function named CALLBACK in JFK.M with the given input arguments.
%
%      JFK('Property','Value',...) creates a new JFK or raises the
%      existing singleton*.  Starting from the left, property value pairs are
%      applied to the GUI before jfk_OpeningFunction gets called.  An
%      unrecognized property name or invalid value makes property application
%      stop.  All inputs are passed to jfk_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 jfk

% Last Modified by GUIDE v2.5 05-Jun-2005 14:49:29
% Begin initialization code - DO NOT EDIT
gui_Singleton = 1;
gui_State = struct('gui_Name',       mfilename, ...
                   'gui_Singleton',  gui_Singleton, ...
                   'gui_OpeningFcn', @jfk_OpeningFcn, ...
                   'gui_OutputFcn',  @jfk_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 jfk is made visible.
function jfk_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 jfk (see VARARGIN)

% Choose default command line output for jfk
handles.output = hObject;

% Update handles structure
guidata(hObject, handles);

% UIWAIT makes jfk wait for user response (see UIRESUME)
% uiwait(handles.figure1);


% --- Outputs from this function are returned to the command line.
function varargout = jfk_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)% --- Executes on button press in pushbutton2.

n=ceil(get(handles.num_n,'Value'))+eps;
kd=ceil(get(handles.num_kd,'Value'))+eps;
a=ceil(get(handles.num_a,'Value'))+eps;
for t1=1:32
    t=t1./16.*pi;
   z=sin(n/2*(2*pi*kd.*cos(t)-a.*2.*pi))./sin(1/2*(2*pi*kd.*cos(t)-a.*2.*pi));
   axes(handles.num_axes);
   polar(t,z);axis tight;
   m(t1)=getframe;
end
movie(m,2)

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)% --- Executes during object creation, after setting all properties.
close;function num_n_CreateFcn(hObject, eventdata, handles)% hObject    handle to num_n (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 num_n_Callback(hObject, eventdata, handles)% hObject    handle to num_n (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 on button press in pushbutton5.function pushbutton5_Callback(hObject, eventdata, handles)% hObject    handle to pushbutton5 (see GCBO)% eventdata  reserved - to be defined in a future version of MATLAB% handles    structure with handles and user data (see GUIDATA)
t1=(0:0.01:1).*2.*pi;n1=ceil(get(handles.num_n,'Value')+eps);
kd1=ceil(get(handles.num_kd,'Value'))+eps;
a1=ceil(get(handles.num_a,'Value'))+eps;
z1=sin(n1/2*(2*pi*kd1.*cos(t1)-a1.*2.*pi))./sin(1/2*(2*pi*kd1.*cos(t1)-a1.*2.*pi));
axes(handles.num_axes);
polar(t1,z1);axis tight;% --- Executes during object creation, after setting all properties.function num_t_CreateFcn(hObject, eventdata, handles)% hObject    handle to num_t (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 num_t_Callback(hObject, eventdata, handles)% hObject    handle to num_t (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 num_a_CreateFcn(hObject, eventdata, handles)% hObject    handle to num_a (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 num_a_Callback(hObject, eventdata, handles)% hObject    handle to num_a (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 num_kd_CreateFcn(hObject, eventdata, handles)% hObject    handle to num_kd (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 num_kd_Callback(hObject, eventdata, handles)% hObject    handle to num_kd (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

⌨️ 快捷键说明

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