如何在Matlab中设置uipanel大小并在uipanel中添加滑块? [英] How to set the uipanel size in matlab and add slider in the uipanel?

查看:465
本文介绍了如何在Matlab中设置uipanel大小并在uipanel中添加滑块?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在matlab GUI的uipanel中显示输出消息. 如果我使用此代码,

I Wanna display the output messeges in the uipanel in matlab GUI. and if i use this code,

  hp1 = uipanel('Title','UI Panel 1',...
  'Position', [157.6  30.308  62.4  12.615]);

  uicontrol(...
  'Parent', hp1,...
   'Style','text',...
   'Units', 'Normalized', 'Position', [0 0 1 1],...
   'String', psancitra1);

uipanel的大小和位置是如此之大,位于窗口的中心.

the size and the position of the uipanel is so big and located in the center of window.

如何设置uipanel的位置,大小(宽度,长度)?

How to set the position, the size(width,long) of the uipanel?

以及如何在uipanel中添加滑块,因此,如果信息行( psancitra1 )大于uipanel的大小,我们可以使用scoll栏吗?

and how to add a slider in the uipanel, so if the messeges line (psancitra1) is more than the size of the uipanel, we can use the scoll bar?

感谢您:D之前的帮助

推荐答案

如何设置uipanel的位置,大小(宽度,长度)?

How to set the position, the size(width,long) of the uipanel?

使用'Position'(位置),在[底部宽度的左下角]定义uicontrol的放置位置.您还应该检查参数单位.

With 'Position', [left bottom width height] you define where your uicontrol is placed. You should also check the parameter Units.

例如这样的

    h=figure;
    hp1 = uipanel('Parent', h,'Units','Normalized','Title','UI Panel 1',...
    'Position', [0 0 .5 0.3]);  
    uicontrol('Parent', hp1,'Style','text',...
    'Units', 'Normalized', 'Position', [0 0 0.5 1],...
    'String', 'psancitra1');

您也可以在mathworks上查看文档: matlab:uicontrol属性->位置

You can also check the documentation at mathworks: matlab: uicontrol properties-> position

这篇关于如何在Matlab中设置uipanel大小并在uipanel中添加滑块?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆