Mathematica 9 is now available
Services & Resources / Wolfram Forums / MathGroup Archive
-----

MathGroup Archive 2010

[Date Index] [Thread Index] [Author Index]

Search the Archive

Displaying a table

  • To: mathgroup at smc.vnet.net
  • Subject: [mg110075] Displaying a table
  • From: "S. B. Gray" <stevebg at ROADRUNNER.COM>
  • Date: Tue, 1 Jun 2010 04:22:07 -0400 (EDT)
  • Reply-to: stevebg at ROADRUNNER.COM

I 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.


subx = {0, 0, 0, 0, 0, 0};              (* this is an example *)
lenx = Length[subx];
circorr = Table[0, {lenx}, {lenx}];
circorr[[2, 5]] = 6;
circorr[[3, 4]] = 8;                    (* Only examples. *)
ts1 = ToString[circorr];
ts1 = StringReplace[ts1, ", " -> "   "];
ts1 = StringReplace[ts1, "{" -> ""];
ts1 = StringReplace[ts1, "}" -> "\r"];  (* To print >0 in Bold? *)
Print["   ", TableForm[ts1]]            (* which gives this: *)

    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

Thanks to everyone for past and present help.

Steve Gray


  • Prev by Date: Re: Dynamic not displaying the current value
  • Next by Date: Re: loop for with plot
  • Previous by thread: Re: Dynamic not displaying the current value
  • Next by thread: Re: Displaying a table