MATLAB Answers

0

How to display table output in parentheses?

Asked by Corrupted on 10 Sep 2019 at 4:20
Latest activity Commented on by Corrupted on 10 Sep 2019 at 6:17
I have a table displaying my output:
table = [s0, (e0)
s1, (e1)
s2, (e2)
s3, (e3)]
But in the complier it displays:
0.87758 0.00000
1.00000 13.94939
0.87500 0.29428
0.87760 0.00246
How do I get it so that the right column remains in paraenthesis.

  4 Comments

Show 1 older comment
Corrupted on 10 Sep 2019 at 4:36
I am not quite sure what you mean. From my understanding it sounds like you want me to do:
fprintf('table = [s0, (e0) s1, (e1) s2, (e2) s3, (e3)]\n')
But that returns:
table = [s0, (e0) s1, (e1) s2, (e2) s3, (e3)]
Which isn't what I want, I just want the right column to be in parathenses.
fprintf('table = [%12.5f(%12.5f)', s0, e0);
fprintf('\n %12.5f(%12.5f)', [s1, e1; s2, e2; s3, e3].');
fprintf(']\n');
It would be easier if the 'table = [' were not part of the output on the same line.
Corrupted on 10 Sep 2019 at 6:17
ok this makes sense after some formating I got this to how I wanted it. Thank you.

Sign in to comment.

0 Answers