matlab 语法的简便,在 GUI 上也不遑多让呀;

  • uigetfile

    [filename, pathname] = uigetfile('*.m', 'choose a m file')

1. 创建对话框程序

button = questdlg('qstring','title','str1','str2',default)
% 第一个参数:显示的字符串
% 第二个参数:表示对话框的标题
% 后续可变参数表示,不同的按钮
% 最后一个字符串为默认选定的按钮,(需在前面已经出现)
% 返回值为选中的按钮对应的文本类型
button = questdlg('qstring','title','str1','str2','str1') 

2. 交互式获取矩形区域的坐标

>> rect = getrect
% in current axes
>> rect = getrect(fig)
% in the current axes of
figure fig
>> rect = getrect(ax)
% in the axes specified by
the handle ax.

Use the mouse to click and drag the desired rectangle(用鼠标拖拽获得期望的矩形区域). rect is a four-element vector with the form [xmin ymin width height](返回值是四个元素构成的一个vector). To constrain the rectangle to be a square, use a shift- or right-click to begin the drag.(想要限制这个矩形为一个正方形,使用shift或者单击右键开始拖拽)

3. 输入框

prompt = {'Enter image name:', 'Enter colormap name:'};
title = 'Image display - assignin example';
lines = 1;
def = {'my_image', 'hsv'}; answer = inputdlg(prompt, title, lines, def);
% answer 接收输入框文本的值; assignin('base', 'imfile', answer{1});
assignin('base', 'cmap', answer{2});
% 在 base workspace 下创建两个变量,imfile,cmap,并赋字符串值

matlab GUI 编程的更多相关文章

  1. MATLAB串口操作和GUI编程

    程序说明 V1.0 2015/2/08 MATLAB串口操作和GUI编程   概述   本文介绍了程序AD9512_Serial_GUI的编程思路和功能.该程序设计到MATLAB的图像用户界面编程的基 ...

  2. [学习一个] Matlab GUI 学习笔记 Ⅰ

    Matlab GUI 学习笔记 Ⅰ 1. Foreword Matlab 是严格意义上的编程语言吗?曾经有人告诉我他是通过 Matlab 学会了面对对象编程,我是不信的,但这依然不妨碍它在特殊领域的强 ...

  3. Matlab GUI读入图片

    % --- Executes on button press in pushbutton1. function pushbutton1_Callback(hObject, eventdata, han ...

  4. Matlab GUI程序设计入门——信号发生器+时域分析

    背景:学习matlab gui编程入门,完成一个基于GUIDE的图形化界面程序,结合信号生成及分析等. 操作步骤: 1.新建程序 新建一个GUIDE程序 这里选择第一个选项,即创建一个空白的GUIDE ...

  5. matlab GUI界面编程总结

    去年做了一些关于Matlab GUI的程序,现在又要做相关的东西,回想起来,当时很多经验没有记录下来,现在回顾起来始终觉得不爽,所以从现在开始,一定要勤写记录. 从简单的例子说起吧. 创建Matlab ...

  6. java matlab 混合编程 Failed to find the required library mclmcrrt9_2.dll on java.library.path.

    问题描述: Exception in thread "main" java.lang.UnsatisfiedLinkError: Failed to find the requir ...

  7. matlab GUI工作原理

    例如,用GUIDE创建名为ceshi的GUI程序,其m文件的主函数有如下形式.那么,打开该GUI时,它到底是怎么运行的呢?以下略作小结,欢迎大家补充 function varargout = cesh ...

  8. Matlab——GUI初涉

    Matlab——GUI初涉 MATLAB GUI教学视频0:GUI中的基本操作—在线播放—优酷网,视频高清在线观看http://v.youku.com/v_show/id_XMjM2Mjk0MjM2. ...

  9. [转载] 关于matlab GUI的一点心得

    转载自 落落轻尘 [Fig文件方式,即使用菜单File->New->GUI来设计界面] 首先值得注意的是,在低版本matlab上制作的含GUI的m文件一般不能在高版本的matlab上面运行 ...

随机推荐

  1. 使用xerces库的一个注意事项

    作者:朱金灿 来源:http://blog.csdn.net/clever101 使用xerces库解析xml文件,结果出现这样一些链接错误: public: static classxercesc_ ...

  2. 数据类型总结——Number(数值类型)

    相关文章 简书原文:https://www.jianshu.com/p/9fb573ef10da 数据类型总结——概述:https://www.cnblogs.com/shcrk/p/9266015. ...

  3. POJ - 2286 - The Rotation Game (IDA*)

    IDA*算法,即迭代加深的A*算法.实际上就是迭代加深+DFS+估价函数 题目传送:The Rotation Game AC代码: #include <map> #include < ...

  4. valgrind,arm-linux交叉编译

    1. 下载及解压valgrind-3.9.0 2.CC=/opt/hisi-linux/x86-arm/arm-hisiv200-linux/target/bin/arm-hisiv200-linux ...

  5. 解决duilib水平布局(HorizontalLayout)中控件位置计算错误的问题

    水平布局中的控件无法布满整个布局,右側留有缝隙 修正后的样子 原因是布局中的代码计算Padding时候逻辑不对导致 修正后的代码到https://github.com/CodeBees/duilib- ...

  6. [React] Understand React.Children Utilities

    The data contained in this.props.children is not always what you might expect. React provides React. ...

  7. 解决“不是有效的win32应用程序”问题

    http://blog.csdn.net/shuaihj/article/details/17096903

  8. 【codeforces 602E】Kleofáš and the n-thlon

    time limit per test1 second memory limit per test256 megabytes inputstandard input outputstandard ou ...

  9. [WebGL入门]十三,minMatrix.js和坐标变换矩阵

    注:文章译自http://wgld.org/,原作者杉本雅広(doxas),文章中假设有我的额外说明,我会加上[lufy:],另外,鄙人webgl研究还不够深入,一些专业词语,假设翻译有误,欢迎大家指 ...

  10. WM_NOTIFY消息流程实例分析

    我们以CListCtrl控件为例来分析WM_NOTIFY消息. CListCtrl控件在Report样式下会包含CHeaderCtrl标头控件,即CHeaderCtrl标头控件为CListCtrl控件 ...