Stats

Popular Posts

Followers

Mathematica 教學 Displaying a table

戴忠淵 於 2010年6月2日星期三 下午8:12 發表

Q: need to display the subx table as shown, with no decimal points or {} and with some spaces between columns. Some entries will be nonzero and it would be nice to show them in boldface. I tried Style with Positive but didn't succeed. This method works but there must be a better way.
circorr = {{0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 6, 0}, {0, 0, 0, 8, 0, 0}, {0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0}}
Ans:
1. Map[If[# != 0, Style[#, Bold], 0] &, circorr, {2}] // MatrixForm
2. circorr /. x_?Positive :> Style[x, Bold] // MatrixForm



Tags: ,

讀者回應 ( 0 意見 )

發佈留言

Please leave your name and tell me what you thought about this site. Comments, suggestions and views are welcomed.

如果這篇文章對你有幫助,那請留個訊息給我~