Display in command window an ordained long list of data with headers

Hi,
I am measuring some sensors, and for this reason I plot in a figure the signals.
Every second I want also to display in the Command Window the value of all signals like the following picture (example of the iterations of a Genetic Algorithm optimization).
In the Command Window, every n row displayed I want to display again the headers (exacly as shown in the pucture after 30 generations).
Every column must be alligned with headers.
How can I do that?
ExampleDisplay.PNG

5 Kommentare

Use fprintf() with specific widths for each output. For example,
fprintf('%5d%19d%17.3f', current_generation, current_func_count, current_best_fx)
You can also use widths for %s:
fprintf('%18s%10s', 'Generation', 'Func-count')
You would adjust the widths to line up your headers properly.
As a user, I would immediately stop using and would delete immediately any code that was constantly spamming my command window. In my opinion, that's very poor UI. I would strongly recommend building a GUI for that.
Dear Guillaume, I already done the GUI but since I need to analyse in detail only one signal, I prefer plot the main signal in the GUI, and when necessary I have a look to the Command window that have got a low frequency update (e.g. 0.5 Hz). Anyhow thanks for your advise!
Then why not add a multiline text box to your GUI, that would have that low frequency update?
Thats is a good advice! I will to that. Thanks a lot ;)
Anyhow I will accept the answer of Walter since it is formally correct.

Melden Sie sich an, um zu kommentieren.

Antworten (0)

Kategorien

Mehr zu MATLAB finden Sie in Hilfe-Center und File Exchange

Produkte

Version

R2018a

Tags

Gefragt:

am 28 Mär. 2019

Kommentiert:

am 28 Mär. 2019

Community Treasure Hunt

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

Start Hunting!

Translated by