请选择 进入手机版 | 继续访问电脑版
楼主: fantuanxiaot
5185 44

[源码分享] [原创]基于MATLAB的一个自动画正玄曲线的界面 [推广有奖]

Ψ▄┳一大卫卍卐席尔瓦

大师

8%

还不是VIP/贵宾

-

威望
7
论坛币
-234475 个
通用积分
123.7824
学术水平
3783 点
热心指数
3819 点
信用等级
3454 点
经验
150207 点
帖子
7546
精华
32
在线时间
1327 小时
注册时间
2013-2-3
最后登录
2022-2-24

初级学术勋章 初级热心勋章 中级热心勋章 中级学术勋章 初级信用勋章 中级信用勋章 高级热心勋章 高级学术勋章 特级学术勋章 特级热心勋章 高级信用勋章 特级信用勋章

相似文件 换一批

+2 论坛币
k人 参与回答

经管之家送您一份

应届毕业生专属福利!

求职就业群
赵安豆老师微信:zhaoandou666

经管之家联合CDA

送您一个全额奖学金名额~ !

感谢您参与论坛问题回答

经管之家送您两个论坛币!

+2 论坛币

偶有灵感,做了一个自动画正玄曲线曲线的界面,分享一下

界面文件如下

本帖隐藏的内容

Active_Gui_Plot.zip (3.32 KB) 本附件包括:
  • Active_Gui_Plot.m
  • Active_Gui_Plot.fig

在figure上移动移动自己的鼠标,按一按自己的鼠标。

Active_Gui_Plot1.jpg


Active_Gui_Plot2.jpg


Active_Gui_Plot3.jpg


Active_Gui_Plot4.jpg

主程序:


本帖隐藏的内容

  1. function varargout = Active_Gui_Plot(varargin)
  2. % ACTIVE_GUI_PLOT M-file for Active_Gui_Plot.fig
  3. %      ACTIVE_GUI_PLOT, by itself, creates a new ACTIVE_GUI_PLOT or raises the existing
  4. %      singleton*.
  5. %
  6. %      H = ACTIVE_GUI_PLOT returns the handle to a new ACTIVE_GUI_PLOT or the handle to
  7. %      the existing singleton*.
  8. %
  9. %      ACTIVE_GUI_PLOT('CALLBACK',hObject,eventData,handles,...) calls the local
  10. %      function named CALLBACK in ACTIVE_GUI_PLOT.M with the given input arguments.
  11. %
  12. %      ACTIVE_GUI_PLOT('Property','Value',...) creates a new ACTIVE_GUI_PLOT or raises the
  13. %      existing singleton*.  Starting from the left, property value pairs are
  14. %      applied to the GUI before Active_Gui_Plot_OpeningFcn gets called.  An
  15. %      unrecognized property name or invalid value makes property application
  16. %      stop.  All inputs are passed to Active_Gui_Plot_OpeningFcn via varargin.
  17. %
  18. %      *See GUI Options on GUIDE's Tools menu.  Choose "GUI allows only one
  19. %      instance to run (singleton)".
  20. %
  21. % See also: GUIDE, GUIDATA, GUIHANDLES

  22. % Edit the above text to modify the response to help Active_Gui_Plot

  23. % Last Modified by GUIDE v2.5 03-Jan-2015 22:15:34

  24. % Begin initialization code - DO NOT EDIT
  25. gui_Singleton = 1;
  26. gui_State = struct('gui_Name',       mfilename, ...
  27.                    'gui_Singleton',  gui_Singleton, ...
  28.                    'gui_OpeningFcn', @Active_Gui_Plot_OpeningFcn, ...
  29.                    'gui_OutputFcn',  @Active_Gui_Plot_OutputFcn, ...
  30.                    'gui_LayoutFcn',  [] , ...
  31.                    'gui_Callback',   []);
  32. if nargin && ischar(varargin{1})
  33.     gui_State.gui_Callback = str2func(varargin{1});
  34. end

  35. if nargout
  36.     [varargout{1:nargout}] = gui_mainfcn(gui_State, varargin{:});
  37. else
  38.     gui_mainfcn(gui_State, varargin{:});
  39. end
  40. % End initialization code - DO NOT EDIT


  41. % --- Executes just before Active_Gui_Plot is made visible.
  42. function Active_Gui_Plot_OpeningFcn(hObject, eventdata, handles, varargin)
  43. % This function has no output args, see OutputFcn.
  44. % hObject    handle to figure
  45. % eventdata  reserved - to be defined in a future version of MATLAB
  46. % handles    structure with handles and user data (see GUIDATA)
  47. % varargin   command line arguments to Active_Gui_Plot (see VARARGIN)

  48. % Choose default command line output for Active_Gui_Plot
  49. handles.output = hObject;

  50. % Update handles structure
  51. guidata(hObject, handles);

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


  54. % --- Outputs from this function are returned to the command line.
  55. function varargout = Active_Gui_Plot_OutputFcn(hObject, eventdata, handles)
  56. % varargout  cell array for returning output args (see VARARGOUT);
  57. % hObject    handle to figure
  58. % eventdata  reserved - to be defined in a future version of MATLAB
  59. % handles    structure with handles and user data (see GUIDATA)

  60. % Get default command line output from handles structure
  61. varargout{1} = handles.output;


  62. % --- Executes when user attempts to close figure1.
  63. function figure1_CloseRequestFcn(hObject, eventdata, handles)
  64. % hObject    handle to figure1 (see GCBO)
  65. % eventdata  reserved - to be defined in a future version of MATLAB
  66. % handles    structure with handles and user data (see GUIDATA)

  67. % Hint: delete(hObject) closes the figure
  68. delete(hObject);
  69. clear all


  70. % --- Executes on mouse press over figure background, over a disabled or
  71. % --- inactive control, or over an axes background.
  72. function figure1_WindowButtonDownFcn(hObject, eventdata, handles)
  73. % hObject    handle to figure1 (see GCBO)
  74. % eventdata  reserved - to be defined in a future version of MATLAB
  75. % handles    structure with handles and user data (see GUIDATA)
  76. persistent g
  77. if isempty(g)
  78.     g=0;
  79. end
  80. cla
  81. set(gca,'visible','off')
  82. g=g+1;
  83. set(hObject,'userdata',g)

  84. % --- Executes on mouse motion over figure - except title and menu.
  85. function figure1_WindowButtonMotionFcn(hObject, eventdata, handles)
  86. % hObject    handle to figure1 (see GCBO)
  87. % eventdata  reserved - to be defined in a future version of MATLAB
  88. % handles    structure with handles and user data (see GUIDATA)
  89. persistent c
  90. if isempty(c)
  91.     c=0;
  92. end
  93. c=c+1;
  94. g=get(hObject,'userdata');
  95. t=0:0.1:c*pi/200;
  96. if g==0
  97.     plot(sin(t),'ks-','markerface','r','markersize',8)
  98. elseif g==1
  99.     plot(sin(t),'ko-','markerface','m','markersize',8)
  100. elseif g==2
  101.     plot(sin(t),'kp-','markerface','g','markersize',8)
  102. else
  103.     plot(sin(t),'kv-','markerface','c','markersize',8)
  104. end  
  105. drawnow;
复制代码



在理解与学习MATLAB中,需要大家是个多面手                                                                                                                                                                                                                                  —————— by faruto


二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

关键词:MATLAB matla atlab Lab Atl function existing creates returns figure

已有 2 人评分经验 学术水平 热心指数 信用等级 收起 理由
zbin7451f + 100 + 5 + 5 + 5 对论坛有贡献
chenyi112982 + 100 + 5 + 5 代码就是王道,支持!

总评分: 经验 + 200  学术水平 + 10  热心指数 + 10  信用等级 + 5   查看全部评分

dnq 发表于 2015-1-3 22:40:17 |显示全部楼层 |坛友微信交流群

回帖奖励 +1

kankan
已有 1 人评分论坛币 收起 理由
fantuanxiaot + 15 鼓励积极发帖讨论

总评分: 论坛币 + 15   查看全部评分

使用道具

dnq 发表于 2015-1-3 22:40
kankan
欢迎常客!

使用道具

tt_abc 发表于 2015-1-3 22:57:45 |显示全部楼层 |坛友微信交流群

回帖奖励 +1

已有 1 人评分论坛币 收起 理由
fantuanxiaot + 3 鼓励积极发帖讨论

总评分: 论坛币 + 3   查看全部评分

使用道具

回帖奖励 +1

已有 1 人评分论坛币 收起 理由
fantuanxiaot + 3 鼓励积极发帖讨论

总评分: 论坛币 + 3   查看全部评分

使用道具

nndbc 发表于 2015-1-3 23:01:45 |显示全部楼层 |坛友微信交流群

回帖奖励 +1

kankankan
已有 1 人评分论坛币 收起 理由
fantuanxiaot + 3 鼓励积极发帖讨论

总评分: 论坛币 + 3   查看全部评分

使用道具

bylake 发表于 2015-1-3 23:10:01 |显示全部楼层 |坛友微信交流群

回帖奖励 +1

看看有啥奥妙
已有 1 人评分经验 收起 理由
fantuanxiaot + 7 精彩帖子

总评分: 经验 + 7   查看全部评分

使用道具

mike68097 发表于 2015-1-4 02:39:12 |显示全部楼层 |坛友微信交流群

回帖奖励 +1

支持!!!!
已有 1 人评分经验 收起 理由
fantuanxiaot + 10 鼓励积极发帖讨论

总评分: 经验 + 10   查看全部评分

使用道具

faruto 发表于 2015-1-4 08:47:50 |显示全部楼层 |坛友微信交流群

回帖奖励 +1

做得不错。
已有 1 人评分论坛币 收起 理由
fantuanxiaot + 5 鼓励积极发帖讨论

总评分: 论坛币 + 5   查看全部评分

使用道具

回帖奖励 +1

哎呦不错哦  看看
已有 1 人评分论坛币 收起 理由
fantuanxiaot + 5 鼓励积极发帖讨论

总评分: 论坛币 + 5   查看全部评分

使用道具

您需要登录后才可以回帖 登录 | 我要注册

本版微信群
加好友,备注jr
拉您进交流群

京ICP备16021002-2号 京B2-20170662号 京公网安备 11010802022788号 论坛法律顾问:王进律师 知识产权保护声明   免责及隐私声明

GMT+8, 2024-3-28 17:53