Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

To resolve issues starting MATLAB on Mac OS X 10.10 (Yosemite) visit: http://www.mathworks.com/matlabcentral/answers/159016

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

Asked by akik biswas on 1 May 2013

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???

3 Comments

Babak on 1 May 2013

you mean command window workspace variables? or commanded window's display (texts displayed in command window)

Jan Simon on 1 May 2013

Please explain more exactly, what you want to write to the text field.

akik biswas on 2 May 2013

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.

akik biswas

Products

No products are associated with this question.

2 Answers

Answer by Yavor Kamer on 1 May 2013

You create a text box and then you update it like this

set(txt_handle,'string','blaaa')

1 Comment

akik biswas on 2 May 2013

I have already done this but it doesn't display my command window results

Yavor Kamer
Answer by Walter Roberson on 1 May 2013

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 Comments

akik biswas on 2 May 2013

Actually my command window datas are continuously changing and i wish to display the same in my static text box

Walter Roberson on 2 May 2013

Yes, and that is the situation that my response addresses.

akik biswas on 2 May 2013

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

Walter Roberson

Contact us