我正在为我的MatLab代码开发一个图形用户界面,它使用UITab和UITabGroup,来自于上一篇文章:
但是,该代码在单个函数中填充每个选项卡ui。由于我的用户界面将比这更复杂,我希望使用它自己的函数.m文件为每个选项卡创建一个图形,然后将该图形导入主GUI函数.m文件中。它试图通过将图形从原始函数返回到主gui中来实现这一点:
选项卡接口:
function tabbedUI = tab_gui1()
... Code for tabbed UI
end
主GUI:
function test_embeddedGUI()
hFig = figure('Menubar
我在Matlab中创建了一个GUI。
我有一个编辑文本框,用户可以在其中输入一个值。该值将为数字。不过,我想做的是,在用户输入完该值之后,以下列方式更新该值.
If they enter the value 5000000 I would want the text box to update to 5,000,000
我不得不说,在Matlab中做GUI有点困难。我似乎找不到像lostFocus这样的事件。这在Matlab中有可能吗?
我目前正在处理一个Matlab项目,该项目涉及GUI。实际上,我想遵循以下步骤
1.通过GUI输入(数字)(已完成)。
将它们存储在input.txt文件中。
使用Matlab程序,从Input.txt获取输入并运行过程,最后将它们存储在Output.txt中(我编写了这段代码,它正在工作)。
最后,从Output.txt获取这些值,并在GUI中显示它们。
以下是我的疑虑:
1. How do i store the inputs from GUI to Input.txt ?
2. What code do i have to write in GUI to triger
我正在尝试从python开始matlab,然后执行一个非常基本的测试。
def execute_matlab_command(command):
handle = win32com.client.DispatchEx('matlab.application')
handle.visible = True
# By using print I know that the handle is valid here
handle.Execute(command)
execute_matlab_handle("x=32")
代码运行良好
我有下面的UIFigure
classdef gui < matlab.apps.AppBase
...
function app = gui
% Construct app
end
...
properties (Access = public)
myFuncRef = @myFun
end
...
function myFun(app)
% do something
end
...
end
其中我定义了方法myFun。
如果图形正在运行(也就是说,它显示了一个窗口),我如何从MATLAB的
我正在做matlab gui。在单击当前gui中的按钮时,我必须调用另一个gui。但是我必须从当前的gui向新的gui传递一些值,比如图像和文本字符串。我该怎么做呢。我只是在没有传递任何信息的情况下打开了新的gui。
function pushbutton8_Callback(hObject, eventdata, handles)
% hObject handle to pushbutton8 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles struc
我有以下问题。比方说,我们有一些用Matlab编写的GUI。让它是mygui.fig和mygui.m。
好的,现在我想重写这个gui并保留它的prev版本。因此,我将这两个文件复制到mygui_new.fig和mygui_new.m。
我们都知道,当我们运行something.fig时,Matlab试图找到something.m,以便对我们的行为执行响应。然而,当我试图运行我的mygui_new.m时,Matlab试图读取mygui.m给我的警告:
Warning: Name is nonexistent or not a directory: ..\..\matlab\PostProcess
我在windows 7 PC上使用matlab R2012a (7.14.0.737) 64位.我有两个监视器。我希望能够打开一个matlab图形在第二个显示器(在左边)。
在命令行开始的数字那里工作很好。
h = figure( ... , 'position',[some -value on the other screen y w h)
但是GUI图形总是在第一个监视器上生成,尽管1)使用代码输入到GUI窗口属性中的正确位置值和/或( 2)
set( hObject, 'position',[some -value on the other screen