How can I display string vector the same way number vectors are displayed
9 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
I have two long vectors:
vector A- int vector with size 1xN
vector B string vector with size of 1xM.
I want to use disp() for displaying both on the command window.
when using disp(A) : since the vector is too long , it automatally show it the folowing way:
Columns 1 through 9
19 21 112 113 23 24 25 26 28
Columns 10 through 18
31 33 117 35 52 54 58 62 68
Columns 19 through 27
69 94 97 100 109 20075 20080 20083 20095
Columns 28 through 30
20099 20110 20124
and that is OK, thats what I want beacuse it is convinent.
but when using disp() with vector B I one giant line , like so:
7 : 0/1, 9 : 0/1, 11 : 0/1, 21 : 1/2, 112 : 0/1, 113 : 0/1, 23 : 3/6, 24 : 6/14, 25 : 3/6, 28 : 2/4, 30 : 1/2, 31 : 2/3, 32 : 1/2, 33 : 1/2, 34 : 2/4, 117 : 2/3, 35 : 3/6, 39 : 0/1, 40 : 0/1, 41 : 0/1, 43 : 0/1, 46 : 0/1, 47 : 0/1, 52 : 0/1, 54 : 0/1, 58 : 0/1, 94 : 1/2, 97 : 1/2, 103 : 0/1, 20070 : 0/1, 20071 : 0/1, 20072 : 0/1, 20073 : 0/1, 20075 : 0/1, 20076
(each value in the string array contains the pattern: "x : y/z,"
How can I display string vector the same way number vectors are displayed?
2 Kommentare
Akzeptierte Antwort
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Characters and Strings 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!