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

  1. Newsgroups: comp.soft-sys.matlab
  2. Path: sparky!uunet!gumby!destroyer!ncar!netnews.whoi.edu!news
  3. From: rich@boreas.whoi.edu
  4. Subject: Re: DISP1:  disp1.m - display text and numbers 
  5. Message-ID: <1993Jan23.233224.11781@netnews.whoi.edu>
  6. Sender: news@netnews.whoi.edu
  7. Organization: Woods Hole Oceanographic Institution
  8. References: <1993Jan23.152729.26892@news.columbia.edu>
  9. Date: Sat, 23 Jan 93 23:32:24 GMT
  10. Lines: 22
  11.  
  12. In article <1993Jan23.152729.26892@news.columbia.edu> mnb2@cunixf.cc.columbia.edu (Mark Broadie) writes:
  13. >Trying to continue the trend, here is an m-file for display
  14. >text and numbers to the screen on a single line.  I had m-files
  15. >filled with statements like
  16. >   disp('x measures blah blah, its value is');  disp(x);
  17. >which (a) uses 2 display statements and (b) does not appear
  18. >on a single line on the screen.  The m-file disp1.m allows the
  19. >statement
  20. >   disp1('x measures blah blah, its value is ', x);
  21. >
  22. > [script deleted]
  23.  
  24. You don't need an m-file for that - just use:
  25.  
  26. disp(['x measures blah blah, its value is ' num2str(x)]);
  27.  
  28.  
  29. --
  30. Rich Pawlowicz ----------------- INTERNET: rich@boreas.whoi.edu
  31. Woods Hole Oceanographic Institution
  32. "Home of the 99 cent squid burger (cheese extra)"
  33. --------------------------------------------------------------
  34.