I have 3 vectors of variable lengths but bounded between 1 and 5 (both inclusive). I need to print them out (in a "nice" way) while the code runs.
Nice := I want to let all the vectors be printed in such a way that the starting value of each vector in each iteration is aligned.
What I have tried:
Current Bad Version
for it=1:length(a)
fprintf(' %4.4f ',a(it))
end
and similar for other two.
This makes them misaligned. If the first vector is only length 1, everything gets messed up.
- Sloppy Output Version
I filled up the empty locations with 0 and printed
for it=1:5
fprintf(' %4.4f ',a(it))
end
but this is sloppy since it gives the reader the wrong impression. The reader will believe that the vector is full length with values 0.
However, this prints it out correctly. All the vectors are appropriately aligned.
Sample
In my code a,b,c are numbers but suppose a,b,c were list of strings. a is the animals I saw today, b is what i ate for lunch and c is where i went today. They vary from day to day.

EDIT : On the last line, Elephant should be RED (in the correct version).