function varargout = gui_eped(varargin)
% GUI_EPED MATLAB code for gui_eped.fig
% GUI_EPED, by itself, creates a new GUI_EPED or raises the existing
% singleton*.
%
% H = GUI_EPED returns the handle to a new GUI_EPED or the handle to
% the existing singleton*.
%
% GUI_EPED('CALLBACK',hObject,eventData,handles,...) calls the local
% function named CALLBACK in GUI_EPED.M with the given input arguments.
%
% GUI_EPED('Property','Value',...) creates a new GUI_EPED or raises the
% existing singleton*. Starting from the left, property value pairs are
% applied to the GUI before gui_eped_OpeningFcn gets called. An
% unrecognized property name or invalid value makes property application
% stop. All inputs are passed to gui_eped_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 gui_eped
% Last Modified by GUIDE v2.5 12-Sep-2023 20:26:05
% Begin initialization code - DO NOT EDIT
gui_Singleton = 1;
gui_State = struct('gui_Name', mfilename, ...
'gui_Singleton', gui_Singleton, ...
'gui_OpeningFcn', @gui_eped_OpeningFcn, ...
'gui_OutputFcn', @gui_eped_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 gui_eped is made visible.
function gui_eped_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 gui_eped (see VARARGIN)
set(handles.a_edit,'string','2');
set(handles.b_edit,'string','2');
% Choose default command line output for gui_eped
handles.output = hObject;
% Update handles structure
guidata(hObject, handles);
% UIWAIT makes gui_eped wait for user response (see UIRESUME)
% uiwait(handles.figure1);
% --- Outputs from this function are returned to the command line.
function varargout = gui_eped_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 a_edit_Callback(hObject, eventdata, handles)
% hObject handle to a_edit (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 a_edit as text
% str2double(get(hObject,'String')) returns contents of a_edit as a double
% --- Executes during object creation, after setting all properties.
function a_edit_CreateFcn(hObject, eventdata, handles)
% hObject handle to a_edit (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 b_edit_Callback(hObject, eventdata, handles)
% hObject handle to b_edit (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 b_edit as text
% str2double(get(hObject,'String')) returns contents of b_edit as a double
% --- Executes during object creation, after setting all properties.
function b_edit_CreateFcn(hObject, eventdata, handles)
% hObject handle to b_edit (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 on button press in eped_button.
function eped_button_Callback(hObject, eventdata, handles)
% hObject handle to eped_button (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
a=str2num(get(handles.a_edit,'string'));
b=str2num(get(handles.b_edit,'string'));
x=-6:0.6:6;
y=x;
q=2e-6;
k=9e9;
[X,Y]=meshgrid(x,y);
rp=sqrt((X-a).^2+(Y-b).^2);
rm=sqrt((X+a).^2+(Y+b).^2);
V=q*k*(1./rp-1./rm);
[Ex,Ey]=gradient(-V);
AE=sqrt(Ex.^2+Ey.^2);
Ex=Ex./AE;Ey=Ey./AE;
cv=linspace(min(min(V)),max(max(V)),49);
contourf(X,Y,V,cv,'k-');
title('偶极子的电势和电场强度','fontsize',14);
hold on
quiver(X,Y,Ex,Ey,0.7);
plot(a,b,'wo',a,b,'w+');
plot(-a,-b,'wo',-a,-b,'w-');
xlabel('x');ylabel('y');
hold off
% --- Executes on button press in close_button.
function close_button_Callback(hObject, eventdata, handles)
% hObject handle to close_button (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
close
没有合适的资源?快使用搜索试试~ 我知道了~
【电场分布】基于matlab电偶极子电场分布【含Matlab源码 3555期】.zip
共3个文件
m:1个
jpg:1个
fig:1个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
0 下载量 12 浏览量
2023-12-03
22:23:41
上传
评论
收藏 145KB ZIP 举报
温馨提示
CSDN海神之光上传的全部代码均可运行,亲测可用,尽我所能,为你服务; 1、代码压缩包内容 主函数:main.m; 调用函数:其他m文件;无需运行 运行结果效果图; 2、代码运行版本 Matlab 2019b;若运行有误,根据提示修改;若不会,可私信博主; 3、运行操作步骤 步骤一:将所有文件放到Matlab的当前文件夹中; 步骤二:双击打开main.m文件; 步骤三:点击运行,等程序运行完得到结果; 4、物理应用 仿真:导航、地震、电磁、电路、电能、机械、工业控制、水位控制、直流电机、平面电磁波、管道瞬变流、刚度计算 光学:光栅、杨氏双缝、单缝、多缝、圆孔、矩孔衍射、夫琅禾费、干涉、拉盖尔高斯、光束、光波、涡旋 定位问题:chan、taylor、RSSI、music、卡尔曼滤波UWB 气动学:弹道、气体扩散、龙格库弹道 运动学:倒立摆、泊车 天体学:卫星轨道、姿态 船舶:控制、运动 电磁学:电场分布、电偶极子
资源推荐
资源详情
资源评论
收起资源包目录
【电场分布】基于matlab电偶极子电场分布【含Matlab源码 3555期】.zip (3个子文件)
【电场分布】基于matlab电偶极子电场分布【含Matlab源码 3555期】
gui_eped.m 6KB
运行结果.jpg 122KB
gui_eped.fig 28KB
共 3 条
- 1
资源评论
海神之光
- 粉丝: 3w+
- 资源: 2102
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- navicat开发教程.docx
- 基于图像的机器人视觉伺服系统研究
- CAD实验报告:制药车间动力控制系统图、烘烤车间电气控制图、JSJ型晶体管式时间继电器原理图、液位控制器电路图
- IMG_9692.PNG
- 基于SpringBoot+Vue 的网上书城项目源码+数据库脚本(毕业设计)
- 基于springboot+vue的网上书店系统源码+数据库+使用文档(高分毕设)
- 前端学习路线推荐+自己做的一个前端项目(旅游线路推广)+通过购买腾讯云服务器上传的个人经历(附带部分关键源码)
- 制造业IT规划咨询汇报方案
- 开车不犯困100首.之1~10,DJ
- Keil 找不到编译器 Missing:Complier Version5 的解决方法
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功