Display "hello world" in GUI's app.systemlog
8 次查看(过去 30 天)
显示 更早的评论
I have a blank MATLAB application, I dragged in the System Log (called "app.systemlog"). I have also dragged in a button which runs a script called "test.m"
How do I display "hello world" in my GUIs System Log by running "test.m" ? Please specify what I would need to adjust in both the "test.m" and in the application itself.
Any help is greatly appreciated!
0 个评论
回答(2 个)
Swastik Sarkar
2025-6-26
I assume that the reference to SystemLog pertains to the following UI component:
According to the documentation, this component is intended for displaying console log messages from a real-time Speedgoat target computer within a MATLAB app or UI.
However, for the described use case— displaying custom messages such as "hello world"— the TextArea UI component may be more appropriate. This component allows for programmatic updates to its content, making it suitable for general-purpose logging within an app. Further details on the TextArea component are available here:
To implement the desired functionality, the test.m script can be modified as follows:
function test(app)
app.TextArea.Value = [app.TextArea.Value; "hello world"];
end
This code appends the string "hello world" to the existing content of the TextArea.
Hope this helps !
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Target Computer Setup 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!