Labeling Columns in matrices with pre-calculated outputs.
Show older comments
Hi, I was trying to figure out how to display something like this for an output to problem. I have variable vectors for the angles, and heights respectively. How is the best way to display this matrix with the headers. How can it be done with the disp function, and not the fprintf function.
Angle Height
Degrees Meters
30.85 71.68
32.19 75.53
31.20 72.69
28.41 64.91
Answers (1)
Image Analyst
on 16 Feb 2015
You could do this but the columns don't line up nicely:
disp(' Angle Height');
disp(' Degrees Meters');
a=[...
30.85 71.68
32.19 75.53
31.20 72.69
28.41 64.91];
disp(a)
The command window results:
Angle Height
Degrees Meters
30.85 71.68
32.19 75.53
31.2 72.69
28.41 64.91
Why do you have an objection to the so much more versatile and powerful fprintf()??????
Categories
Find more on MATLAB Mobile Fundamentals in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!