Question:
Programming with proper matrix, fraction display in output?
athemat
2017-08-21 05:23:36 UTC
I want to program math calculations in any language (C, Pascal, Fortran) or calculation package (Matlab, Scilab, Freemat). My problem is how to output in a way so that matrices and fractions are displyed properly? Anyone has a way (must be able to do calculations from given input AND produce a readable, viewable output (monitor, or file))

ex. two thirds to be displayed as two over three with a line o proper width between them
a matrix that has elements to be printed with column and line alignment, even if there is a fraction or decimal.
Four answers:
ooorah
2017-08-21 13:52:29 UTC
MATLAB has the Symbolic Math Toolbox, which includes some functions like "pretty", which will output fractions and other equations in a formatted manner. If you don't have the symbolic toolbox, you can try just playing around with the "rat" function or format for just rational fractions, though it won't be displayed quite as nicely.



Live Script with the Symbolic Math Toolbox is even better, as it will actually format the equations and everything very neatly.
?
2017-08-21 06:19:01 UTC
yess....
?
2017-08-21 05:27:27 UTC
Dnn
2017-08-21 05:25:15 UTC
eeeeeeeeeeeeeeeee


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Loading...