matlab进度条
来源:互联网 发布:平台软件下载 编辑:程序博客网 时间:2024/06/11 05:50
<strong><span style="font-size:24px;">这是用matlab制作的进度条</span></strong>
</pre><pre name="code" class="plain">function h=mywaitbar(varargin)%这是窗口内嵌的进度条%if nargin ==0 % %直接调用函数,默认创建 hWaitbar=waitbar(0,'嵌入式进度条','visible','off'); hAxes=findall(hWaitbar,'type','axes'); h_axes=copyobj(hAxes,gcf); set(h_axes,'Units','pixels'); pos =get(h_axes,'position'); set(h_axes,'position',[10,10,pos(3:4)]);else if nargin>1 x=varargin{1}; whichbar=varargin{2}; if(nargin==5)&&(ischar(whichbar)||iscell(whichbar)) hWaitbar=waitbar(x,whichbar,'visible','off'); hAxes=findall(hWaitbar,'type','axes'); h_axes=copyobj(hAxes,varargin{3}); set(h_axes,'Units','pixels'); pos =get(h_axes,'position'); set(h_axes,'position',[varargin{3},varargin{3},pos(3:4)]); else if isnumeric(whichbar) h_axes=whichbar; hPatch=findobj(h_axes,'Type','patch'); set(hPatch,'XData',[0 100*x 100*x 0]); if nargin==3 hTitle=get(h_axes,'title'); set(hTitle,'string',varargin{3}); end else error('input arguments error...'); end end endendif nargout==1 h=h_axes;end
</pre><pre name="code" class="plain">
</pre><pre name="code" class="plain">
</pre><pre name="code" class="plain">
</pre><p>之后在命令行中输入:</p><p><pre name="code" class="html"> gca;h=waitbar(0,'开始绘图...','WindowStyle','modal');t=0:0.01:pi;for i=1:10 plot(t,sin(2*pi*i*t)); waitbar(i/10,h,['已完成' num2str(10*i) '%']); pause(1);endclose(h);
结果如下:
0 0
- matlab进度条
- matlab进度条
- Matlab--------------进度条的使用
- matlab学习---------------进度条waitbar
- 【matlab】进度条(waitbar)
- Matlab GUI,进度条(waitbar)
- Matlab 进度条效果
- matlab for循环执行进度条,每50更新一次进度条
- matlab修改waitbar进度条颜色的方法
- MATLAB GUI嵌入进度条(waitBar)
- 【matlab】进度条嵌入主GUI界面
- matlab 进度条/waitbar 显示运行进度
- matlab GUI之常用对话框(二)---进度条的使用方法
- matlab GUI之常用对话框(二)---进度条的使用方法
- 进度条
- 进度条
- 进度条
- 进度条
- 排序算法--冒泡排序法
- IOS学习之—— 定时器 NSTimer 和 CADisplayLink 类的使用
- MapReduce 作业提交执行过程代码分析(Hadoop 1.2.1)
- 学习笔记之2016.3.30
- img标签没有文字提示的问题
- matlab进度条
- POJ2229 Sumsets(DP)
- Windows7+Pycharm搭建Spark的开发环境
- Java虚拟机学习 - 内存调优
- 【Redis源码剖析】 - Redis内置数据结构之字典dict
- ZOJ 2836 Number Puzzle
- 使用 dos 打包 Maven成 jar 在dos 下运行
- Spring学习——(四)Spring中的AOP配置
- IOS学习之——位图上下文 -- 水印图片