How to display the Matlab command window data in GUI static text

1 次查看(过去 30 天)
say I run a function which continuously displays data in the matlab command window. How do I display the command window values in static text in GUI???
  4 个评论
akik biswas
akik biswas 2013-5-2
Actually i have an Arduino current sensor, the values of which are displayed in the command window after linking my arduino and matlab. I have made a static text box and i wish to display the command window output in the static text box.
syat mat zin
syat mat zin 2017-12-5
Hi akik biswas,
i face the problem as your before. are you find the solution. if yes can you teach me how to how to show the output data

请先登录,再进行评论。

回答(2 个)

Yavor Kamer
Yavor Kamer 2013-5-1
You create a text box and then you update it like this
set(txt_handle,'string','blaaa')

Walter Roberson
Walter Roberson 2013-5-1
If your desire is to be running a function and, without changing the code the function uses to display values, you want to display copies of the command-line output in your GUI, then the only documented way for you to do that "on the fly" is to override the display(), fprintf(), and fwrite() routines to make them take copies as well as to do their intended work.
If you were using two different MATLAB sessions, and MATLAB R2012b or later, then you could use "diary" in one of the sessions before running the function, and then in the other MATLAB session be continually reading from the diary file and displaying it. "diary" does exist in earlier MATLAB, but the buffering of the output would make it not much "on the fly".
  3 个评论
akik biswas
akik biswas 2013-5-2
I am using matlab 2010a and what do you mean by " override the display(), fprintf(), and fwrite() routines to make them take copies as well as to do their intended work" . could you possibly explain with an example

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Entering Commands 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by