Display in command window an ordained long list of data with headers
Ältere Kommentare anzeigen
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?

5 Kommentare
Walter Roberson
am 28 Mär. 2019
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.
Guillaume
am 28 Mär. 2019
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.
Alberto Mora
am 28 Mär. 2019
Guillaume
am 28 Mär. 2019
Then why not add a multiline text box to your GUI, that would have that low frequency update?
Alberto Mora
am 28 Mär. 2019
Antworten (0)
Kategorien
Mehr zu MATLAB finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!