MATLAB Answers

How to display table output in parentheses?

3 views (last 30 days)
Corrupted on 10 Sep 2019
Commented: Corrupted on 10 Sep 2019
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.


Show 1 older comment
Corrupted on 10 Sep 2019
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.
Walter Roberson
Walter Roberson on 10 Sep 2019
fprintf('table = [%12.5f(%12.5f)', s0, e0);
fprintf('\n %12.5f(%12.5f)', [s1, e1; s2, e2; s3, e3].');
It would be easier if the 'table = [' were not part of the output on the same line.
Corrupted on 10 Sep 2019
ok this makes sense after some formating I got this to how I wanted it. Thank you.

Sign in to comment.

Answers (0)