How to Display a Long Array in Command Window without Showing which Columns they are from.
23 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Eric Cheatwood
am 4 Nov. 2017
Kommentiert: Eric Cheatwood
am 4 Nov. 2017
Hi everyone,
I have a 1 x 300 array of numbers that I would like to display in the command window but I don't want the display showing the columns represented in each row. I'm just looking for a clean block of separated numbers as if the spaces weren't there. So far, I have thought about using a while loop with a counter to advance each set or 14 data points to display until all the rows are display. Does anyone have any more clever or simpler ways of completing this?
Thanks, Eric
0 Kommentare
Akzeptierte Antwort
Walter Roberson
am 4 Nov. 2017
perLine = 14;
fmt = [repmat('%8.4f ', 1, perLine), '\n'];
fprintf(fmt, YourVector);
if mod( length(YourVector), perLine) ~= 0; fprintf('\n'); end
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Matrix Indexing finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!