home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / comp / softsys / matlab / 153 < prev    next >
Encoding:
Text File  |  1993-01-25  |  1.5 KB  |  37 lines

  1. Newsgroups: comp.soft-sys.matlab
  2. Path: sparky!uunet!usc!sol.ctr.columbia.edu!news.columbia.edu!cunixf.cc.columbia.edu!mnb2
  3. From: mnb2@cunixf.cc.columbia.edu (Mark Nathan Broadie)
  4. Subject: Re: DISP1:  disp1.m - display text and numbers 
  5. Message-ID: <1993Jan25.142824.5268@news.columbia.edu>
  6. Sender: usenet@news.columbia.edu (The Network News)
  7. Nntp-Posting-Host: cunixf.cc.columbia.edu
  8. Reply-To: mnb2@cunixf.cc.columbia.edu (Mark Broadie)
  9. Organization: Columbia University
  10. References: <1993Jan23.152729.26892@news.columbia.edu> <1993Jan25.103610.12912@afit.af.mil>
  11. Date: Mon, 25 Jan 1993 14:28:24 GMT
  12. Lines: 23
  13.  
  14. Thanks for the comments about disp1.m.  I realize you don't need
  15. an m-file for this, but it's easier.  disp1.m takes up to 10 
  16. arguments, with strings or numbers in any order.  fprintf and
  17. sprintf are limited to 3 arguments.  disp1 is slightly simpler
  18. and shorter than using num2str directly:
  19.     disp1('x = ', x, ' y = ', y)
  20. vs.
  21.     disp(['x = ' num2str(x) ' y = ' num2str(y)])
  22.  
  23. In general, I find that display information 'nicely' is not easy
  24. with MATLAB.  For example, does anyone have a *simple* way to
  25. display a small table with row and column headings.  By simple,
  26. I mean not having to count spaces.  For example, an m-file
  27. to display
  28.  
  29.                  Col1 head     Col2 heading      Col3 head
  30. Row1 label           0.0            1.0             -3.4
  31. Row2 label here      0.0            1.0             -3.4
  32. Row3 label           0.0            1.0             -3.4
  33.  
  34.  
  35. -mark broadie
  36.  
  37.