function varargout = cylinder(varargin)
% CYLINDER MATLAB code for cylinder.fig
% CYLINDER, by itself, creates a new CYLINDER or raises the existing
% singleton*.
%
% H = CYLINDER returns the handle to a new CYLINDER or the handle to
% the existing singleton*.
%
% CYLINDER('CALLBACK',hObject,eventData,handles,...) calls the local
% function named CALLBACK in CYLINDER.M with the given input arguments.
%
% CYLINDER('Property','Value',...) creates a new CYLINDER or raises the
% existing singleton*. Starting from the left, property value pairs are
% applied to the GUI before cylinder_OpeningFcn gets called. An
% unrecognized property name or invalid value makes property application
% stop. All inputs are passed to cylinder_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 cylinder
% Last Modified by GUIDE v2.5 29-Apr-2023 01:11:39
% Begin initialization code - DO NOT EDIT
gui_Singleton = 1;
gui_State = struct('gui_Name', mfilename, ...
'gui_Singleton', gui_Singleton, ...
'gui_OpeningFcn', @cylinder_OpeningFcn, ...
'gui_OutputFcn', @cylinder_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 cylinder is made visible.
function cylinder_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 cylinder (see VARARGIN)
% Choose default command line output for cylinder
handles.output = hObject;
% Update handles structure
guidata(hObject, handles);
% UIWAIT makes cylinder wait for user response (see UIRESUME)
% uiwait(handles.figure1);
% --- Outputs from this function are returned to the command line.
function varargout = cylinder_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 radiobutton1.
function radiobutton1_Callback(hObject, eventdata, handles)%画△g主剖面
% hObject handle to radiobutton1 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hint: get(hObject,'Value') returns toggle state of radiobutton1
global D
global t
G=6.67*1e-2;
x=-200:10:200;
g=(2*G*t*D)./(x.^2+D^2);
plot(x,g,'*-','MarkerEdgeColor','r');
box on;
xlabel('X(m)');
ylabel('△g.u.');
function edit2_Callback(hObject, eventdata, handles)%对埋深D赋值
% 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
global D
get(hObject,'String');
D=str2double(get(hObject,'String'));
handles.D=D;
guidata(hObject,handles);
% --- 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)%对线密度t赋值
% 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
global t
get(hObject,'String');
t=str2double(get(hObject,'String'));
handles.t=t;
guidata(hObject,handles);
% --- 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
% --- Executes on button press in radiobutton2.
function radiobutton2_Callback(hObject, eventdata, handles)%画重力异常平面等值线图
% hObject handle to radiobutton2 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hint: get(hObject,'Value') returns toggle state of radiobutton2
global D
global t
G=6.67*1e-2;
x=-200:10:200;
y=-200:10:200;
for i=1:size(x,2)
for j=1:size(x,2)
g(j,i)=(2*G*t*D)/(x(i)^2+D^2);
end
end
contourf(x,y,g,12);
colorbar;
box on;
xlabel('X(m)');
ylabel('Y(m)');
% --- Executes on button press in radiobutton3.
function radiobutton3_Callback(hObject, eventdata, handles)
% hObject handle to radiobutton3 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hint: get(hObject,'Value') returns toggle state of radiobutton3
global D
global t
global az
global el
G=6.67*1e-2;
x=-200:10:200;
y=-200:10:200;
for i=1:size(x,2)
for j=1:size(x,2)
g(j,i)=(2*G*t*D)/(x(i)^2+D^2);
end
end
mesh(x,y,g);
view([az,el]);
colorbar;
box on;
xlabel('X(m)');
ylabel('Y(m)');
zlabel('△g.u.');
% --- Executes on button press in radiobutton5.
function radiobutton5_Callback(hObject, eventdata, handles)%画Vxz主剖面
% hObject handle to radiobutton5 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hint: get(hObject,'Value') returns toggle state of radiobutton5
global D
global t
G=6.67*1e-2;
x=-200:10:200;;
Vxz=((4*G*t*(-D)).*x)./((x.^2+D^2).^2);
plot(x,Vxz,'*-','MarkerEdgeColor','r');
box on;
xlabel('X(m)');
ylabel('Vxz');
% --- Executes on button press in radiobutton7.
function radiobutton7_Callback(hObject, eventdata, handles)%画Vxz平面图
% hObject handle to radiobutton7 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hint: get(hObject,'Value') returns toggle state of radiobutton7
global D
global t
G=6.67*1e-2;
x=-200:10:200;
y=-200:10:200;
for i=1:size(x,2)
for j=1:size(x,2)
Vxz(j,i)=(4*G*t*(-D)*x(i))/((x(i)^2++D^2).^2);
end
end
contourf(x,y,Vxz,12);
colorbar;
box on;
xlabel('X(m)');
ylabel('Y(m)');
zlabel('Vxz');
% --- Executes on button press in radiobutton8.
function radiobutton8_Callback(hObject, eventdata, handles)%画Vxz三维图
% hObject handle to radiobutton8 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with
没有合适的资源?快使用搜索试试~ 我知道了~
【数学建模】基于matlab GUI水平圆柱体重力异常正演【含Matlab源码 2558期】.zip
共4个文件
jpg:2个
m:1个
fig:1个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
0 下载量 154 浏览量
2023-04-29
23:47:22
上传
评论 1
收藏 246KB ZIP 举报
温馨提示
代码下载:完整代码,可直接运行 ;运行版本:2014a或2019b;若运行有问题,可私信博主; 博主优势:精通Matlab各领域,且各项目代码较全,可供指导交流。 座右铭:行百里者,半于九十。 1 第一步:海神之光博主主页https://blog.csdn.net/TIQCmatlab?type=blog 2 第二步:搜索相关内容,回车或者点击;然后就出现您需要的文章: 3 Matlab软件下载 与善其事,必先利其器。学习matlab,必须要先下载好matlab软件。 下载链接:Matlab R2020a版安装下载详细操作步骤【Matlab 140期】 4 Matlab基础教程 我们在学习matlab时,如果前面所学知识有部分遗忘,可以及时翻阅课本加深记忆。因此,虽然现在互联网已经非常的发达,但是有一本纸质版的图书也是非常有必要的。 5 学会使用互联网查找知识 现在的互联网非常强大,只靠一本纸质书籍是远远不够的。我们还要学会在网上找一些matlab相关的基础知识进行学习。 6及时进行练习,以免眼高手低 matlab软件要及时的使用起来。我们在学习基础知识时,肯定会遇到很多的小的例子。即使我们对这些例子都能理解也要多使用matlab软件进行验证,看看我们敲出来代码是否也能正常运行。 7 遇到问题及时向博主求助 作为初学者,遇见不会的问题是非常正常的事情。海神之光擅长领域擅长路径规划、优化求解、神经网络预测、图像处理、语音处理等多种领域Matlab仿真,具体代码仿真 私信博主。
资源推荐
资源详情
资源评论
收起资源包目录
【数学建模】基于matlab GUI水平圆柱体重力异常正演【含Matlab源码 2558期】.zip (4个子文件)
【数学建模】基于matlab GUI水平圆柱体重力异常正演【含Matlab源码 2558期】
cylinder.m 17KB
运行结果1.jpg 102KB
cylinder.fig 77KB
运行结果2.jpg 123KB
共 4 条
- 1
资源评论
海神之光
- 粉丝: 5w+
- 资源: 6110
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功