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

Thread Subject:
writing to screen on position

Subject: writing to screen on position

From: Michal Lukac

Date: 2 Mar, 2012 20:07:36

Message: 1 of 4

Hello..
is it possible to write text on a certain position on screen?
I want to display some data during computation on the screen:
e.g.:

Some Label1: 100%
Some Labe2: 80%
Some Labe3: 90%
...
...
I want to just overwite the numbers (percents) not the labels (Not to rewrite all the report again).
is it possible? Something equivalent to C sstatement gotoxy.

thanks
Michal

Subject: writing to screen on position

From: ImageAnalyst

Date: 2 Mar, 2012 23:06:11

Message: 2 of 4

Michal:
If you have a figure window displayed, you can use the text()
function. Did you look up "text" in the help? Be sure to save the
handle text() returns so you can delete it otherwise all your tests
will end up piled on top of one another. If it's in a computationally
intensive loop you might also have to call "drawnow" after your call
to text to get it to display immediately otherwise it might only
display the last one.

Subject: writing to screen on position

From: Michal Lukac

Date: 8 Jun, 2012 08:46:07

Message: 3 of 4

Hello, thanks for repply, I know about this, but I've meant to write into command window not figure. If this is possible..?

Subject: writing to screen on position

From: Star Strider

Date: 8 Jun, 2012 22:10:22

Message: 4 of 4

> Hello, thanks for repply, I know about this, but I've meant to write into command window not figure. If this is possible..?


Apparently not. MATLAB 'fprintf' and 'sprintf' do not support a number of functions they implement. I tried 'fprintf' and 'sprintf' with the '\r' (carriage return without newline) but it produced a newline instead. Of note, the 'alarm' ('\a') also fails to work. It simply prints some sort of non-character. (Windows 7 64-bit).

Tags for this Thread

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us