实例47:曲线标记
h0=figure('toolbar','none',...
'position',[198 56 408 468],...
'name','my second gui');
h1=axes('parent',h0,...
'position',[0.15 0.45 0.7 0.5],...
'visible','on');
x=0:0.1:2*pi;
k=plot(x,sin(x),'*');
xlabel('自变量X');
ylabel('函数值Y');
title('标记类型的改变');
p1=uicontrol('parent',h0,...
'style','pushbutton',...
'string','+',...
'fontsize',20,...
'foregroundcolor',[1 1 1],...
'backgroundcolor',[0 0 0],...
'position',[60 100 50 20],...
'callback','set(k,''marker'',''+'')');
p2=uicontrol('parent',h0,...
'style','pushbutton',...
'string','o',...
'fontsize',20,...
'foregroundcolor',[1 1 1],...
'backgroundcolor',[0 0 0],...
'position',[170 100 50 20],...
'callback','set(k,''marker'',''o'')');
p3=uicontrol('parent',h0,...
'style','pushbutton',...
'string','x',...
'fontsize',20,...
'foregroundcolor',[1 1 1],...
'backgroundcolor',[0 0 0],...
'position',[280 100 50 20],...
'callback','set(k,''marker'',''x'')');
p4=uicontrol('parent',h0,...
'style','pushbutton',...
'backgroundcolor',[1 1 1],...
'fontsize',20,...
'fontweight','demi',...
'string','关闭',...
'position',[150 30 80 60],...
'callback','close');
t1=uicontrol('parent',h0,...
'style','text',...
'string','星号',...
'fontsize',12,...
'fontweight','demi',...
'position',[60 120 50 20]);
t2=uicontrol('parent',h0,...
'style','text',...
'string','圆圈',...
'fontsize',12,...
'fontweight','demi',...
'position',[170 120 50 20]);
t3=uicontrol('parent',h0,...
'style','text',...
'string','叉号',...
'fontsize',12,...
'fontweight','demi',...
'position',[280 120 50 20]);
实例48:修改曲型
h0=figure('toolbar','none',...
'position',[198 56 408 468],...
'name','实例48');
h1=axes('parent',h0,...
'position',[0.15 0.45 0.7 0.5],...
'visible','on');
x=0:0.1:2*pi;
k=plot(x,sin(x));
xlabel('自变量X');
ylabel('函数值Y');
title('线型的改变');
p1=uicontrol('parent',h0,...
'style','pushbutton',...
'string','-.',...
'fontsize',20,...
'foregroundcolor',[1 1 1],...
'backgroundcolor',[0 0 0],...
'position',[60 100 50 20],...
'callback','set(k,''linestyle'',''-.'')');
p2=uicontrol('parent',h0,...
'style','pushbutton',...
'string',':',...
'fontsize',20,...
'foregroundcolor',[1 1 1],...
'backgroundcolor',[0 0 0],...
'position',[170 100 50 20],...
'callback','set(k,''linestyle'','':'')');
p3=uicontrol('parent',h0,...
'style','pushbutton',...
'string','-',...
'fontsize',20,...
'foregroundcolor',[1 1 1],...
'backgroundcolor',[0 0 0],...
'position',[280 100 50 20],...
'callback','set(k,''linestyle'',''-'')');
p4=uicontrol('parent',h0,...
'style','pushbutton',...
'backgroundcolor',[1 1 1],...
'fontsize',20,...
'fontweight','demi',...
'string','关闭',...
'position',[150 30 80 60],...
'callback','close');
t1=uicontrol('parent',h0,...
'style','text',...
'string','点划线',...
'fontsize',12,...
'fontweight','demi',...
'position',[60 120 50 20]);
t2=uicontrol('parent',h0,...
'style','text',...
'string','虚线',...
'fontsize',12,...
'fontweight','demi',...
'position',[170 120 50 20]);
t3=uicontrol('parent',h0,...
'style','text',...
'string','实线',...
'fontsize',12,...
'fontweight','demi',...
'position',[280 120 50 20]);
实例49:指定坐标轴范围
h0=figure('toolbar','none',...
'position',[198 56 408 468],...
'name','实例49');
h1=axes('parent',h0,...
'position',[0.15 0.45 0.7 0.5],...
'visible','on');
x=0:0.1:2*pi;
y=sin(x);
plot(x,y);
xlabel('X');
ylabel('Y');
title('坐标轴范围的改变');
h=get(gca,'xlim');
k=get(gca,'ylim');
e1=uicontrol('parent',h0,...
'style','edit',...
'string',eval(num2str(h(1))),...
'horizontalalignment','right',...
'position',[80 120 100 20]);
t1=uicontrol('parent',h0,...
'style','text',...
'string','X轴最小值',...
'position',[100 145 80 20]);
e2=uicontrol('parent',h0,...
'style','edit',...
'string',eval(num2str(h(2))),...
'horizontalalignment','right',...
'position',[80 60 100 20]);
t2=uicontrol('parent',h0,...
'style','text',...
'string','X轴最大值',...
'position',[100 85 80 20]);
e3=uicontrol('parent',h0,...
'style','edit',...
'string',eval(num2str(k(1))),...
'horizontalalignment','right',...
'position',[250 120 100 20]);
t3=uicontrol('parent',h0,...
'style','text',...
'string','Y轴最小值',...
'position',[270 145 80 20]);
e4=uicontrol('parent',h0,...
'style','edit',...
'string',eval(num2str(k(2))),...
'horizontalalignment','right',...
'position',[250 60 100 20]);
t4=uicontrol('parent',h0,...
'style','text',...
'string','X轴最小值',...
'position',[270 85 80 20]);
p1=uicontrol('parent',h0,...
'style','pushbutton',...
'string','设置',...
'position',[105 10 50 30],...
'callback',[...
'a=str2num(get(e1,''string''));,',...
'b=str2num(get(e2,''string''));,',...
'c=str2num(get(e3,''string''));,',...
'd=str2num(get(e4,''string''));,',...
'axis([a b c d]),',...
'drawnow']);
p2=uicontrol('parent',h0,...
'style','pushbutton',...
'string','关闭',...
'position',[275 10 50 30],...
'callback','close');
实例50:绘制不同函数曲线的用户界面
h0=figure('toolbar','none',...
'position',[198 56 408 468],...
'name','实例50');
h1=axes('parent',h0,...
'position',[0.29 0.45 0.7 0.5],...
'visible','on');
f=uicontrol('parent',h0,...
'style','frame',...
'position',[5 50 90 400]);
p1=uicontrol('parent',h0,...
'style','pushbutton',...
'position',[150 100 60 40],...
'string','绘图',...
'callback',[...
'm=str2num(get(e1,''string''));,',...
'n=str2num(get(e2,''string''));,',...
'a=get(l1,''value'');,',...
'x=m:0.1:n;',...
'if a==1,',...
'plot(x,sin(x)),',...
'end,',...
'if a==2,',...
'plot(x,cos(x)),',...
'end,',...
'if a==3,',...
'plot(x,exp(x)),',...
'end']);
p2=uicontrol('parent',h0,...
'style','pushbutton',...
'position',[270 100 60 40],...
'string','关闭',...
'callback','close');
l1=uicontrol('parent',h0,...
'style','listbox',...
'position',[10 300 80 80],...
'string','sin(x)|cos(x)|exp(x)',...
'value',1,...
'max',0.5,...
'min',0);
f2=uicontrol('parent',h0,...
'style','text',...
'string','选择函数',...
'fontsize',10,...
'position',[10 380 80 20]);
r1=uicontrol('style','radio',...
'string','grid on',...
'value',0,...
'position',[10 100 60 20],...
'callback',[...
'grid on,',...
'set(r1,''value'',1);,',...
'set(r2,''value'',0)']);
r2=uicontrol('style','radio',...
'string','grid off',...
'position',[10 80 60 20],...
'value',1,...
'callback',[...
'grid off,',...
'set(r2,''value'',1);,',...
'set(r1,''value'',0)']);
e1=uicontrol('parent',h0,...
'style','edit',...
'string',0,...
'position',[20 210 60 20],...
'horizontalalignment','right');
e2=uicontrol('parent',h0,...
'style','edit',...
'string','3',...
'position',[20 150 60 20],...
'horizontalalignment','right');
t1=uicontrol('parent',h0,...
'style','text',...
'string','X from',...
'fontsize',10,...
'position',[20 230 60 20],...
'horizontalalignment','center');
t2=uicontrol('parent',h0,...
'style','text',...
'string','To',...
'fontsize',10,...
'position',[20 170 60 20],...
'horizontalalignment','cent
Matlab实用程序百例
需积分: 0 131 浏览量
更新于2008-11-23
收藏 21KB RAR 举报
《Matlab实用程序百例》是一本集合了100个常见Matlab应用的资源集,旨在帮助用户深入了解和熟练运用Matlab这一强大的数学计算软件。Matlab是MathWorks公司开发的一种多领域编程语言,广泛应用于工程计算、数据分析、算法开发、模型创建等多个领域。通过这些实例,我们可以学习到Matlab在不同场景下的具体应用和编程技巧。
在《Matlab实用程序百例》的第一部分,"matlab实用程序百例1.txt"中,可能涵盖了基础的矩阵操作和数值计算。这包括矩阵的创建、索引、运算,以及数值求解方程组的方法,如高斯消元法、LU分解等。此外,还可能涉及到数据的导入导出、基本绘图功能,如二维和三维图形的绘制,以及图像处理的基本操作。
第二部分,“matlab实用程序百例2.txt”可能进一步深入到更复杂的数学运算和数据分析。例如,傅里叶变换在信号处理中的应用,优化问题的解决,如梯度下降法、牛顿法,还有统计分析,如回归分析、假设检验等。这部分也可能包含了一些动态系统建模和仿真,比如状态空间模型的构建与求解。
“matlab实用程序百例3.txt”可能涉及了Matlab在高级应用中的实例,如控制系统设计、金融建模、机器学习算法实现等。控制理论中,可能会有PID控制器的设计,线性系统的稳定性分析;在金融领域,可能会介绍如何使用Matlab进行股票预测或风险评估;在机器学习方面,可能包括简单的线性回归、逻辑回归,甚至神经网络的构建和训练。
每一份文本文件都可能包含详细的代码注释和解释,便于读者理解每个步骤的作用和背后的数学原理。通过这些实例,用户不仅可以提高Matlab编程技能,还能深化对相关领域知识的理解,将理论与实践相结合,提升解决问题的能力。
《Matlab实用程序百例》是一部实用的教程,适合初学者和有一定经验的Matlab用户。它提供了丰富的实践素材,有助于读者巩固基础知识,掌握高级功能,从而更好地利用Matlab解决实际问题。

drui1
- 粉丝: 2
- 资源: 73
最新资源
- 管家婆辉煌食品版TOP+12.71.zip
- 基于COMSOL的电弧磁流体多场耦合仿真模型:电弧放电与MHD模拟分离过程研究,COMSOL电弧磁流体动网格仿真模型:电弧放电与多场耦合模拟分离过程研究,COMSOL电弧磁流体仿真模型,电弧放电仿真
- struts2ognl说明
- 企业FPGA AHB verilog全套IP源代码:ic设计验证与soc开发的学习宝库,企业FPGA AHB verilog全套源代码解析与应用级实现,学习IC设计与SOC开发的宝藏资源,企业大厂应用
- 自适应动态协议驱动的线性多智能体系统分布式一致性优化策略,线性多智能体系统的自适应动态协议分布式一致性技术研究,具有自适应动态协议的线性多智能体系统分布式一致性 ,核心关键词:自适应动态协议;线性多智
- Screenshot_2025-02-19-13-41-21-257_net.csdn.csdnplus.jpg
- 管家婆辉煌食品版TOP+12.81.zip
- 管家婆辉煌食品版TOP+12.91.zip
- 管家婆辉煌食品版TOP+13.1.zip
- 基于MATLAB的路径规划算法改进:人工势场法解决目标不可达问题详解,内含对比展示图集,改进人工势场法解决Matlab路径规划中的目标不可达问题:从斥力到引力势场的改进展示,matlab路径规划算法
- 双馈电机模型下的高效预测控制技术,双馈电机模型精准预测控制技术:策略、方法与实现,双馈电机模型预测控制 ,双馈电机; 模型预测控制; 控制系统设计; 电机控制技术,双馈电机模型预测控制技术
- 批量将视频ts格式转换为mp4格式的软件
- 最小领导者数分配问题在非线性多智能体有向网络一致性中的重要性探究,非线性多智能体有向网络一致性领导者数分配策略优化研究,非线性多智能体有向网络一致性的最小领导者数分配 ,最小领导者数分配;非线性多智能
- gradle-8.12-bin.zip
- 管家婆辉煌食品版TOP+13.22.zip
- 永磁直驱式风力发电系统Simulink仿真模型:直驱风机与光伏并网综合研究,直驱风机Simulink仿真模型与永磁直驱风力发电系统整体Matlab/Simulink分析-含2018-2021不同版本