🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.soft-sys.matlab
Article #29

Re: DISP1: disp1.m - display text and numbers

#29
From: rich
Date: Sat, 23 Jan 1993 23:32
22 lines
1300 bytes
In article <1993Jan23.152729.26892@news.columbia.edu> mnb2@cunixf.cc.columbia.edu (Mark Broadie) writes:
>Trying to continue the trend, here is an m-file for display
>text and numbers to the screen on a single line.  I had m-files
>filled with statements like
>   disp('x measures blah blah, its value is');  disp(x);
>which (a) uses 2 display statements and (b) does not appear
>on a single line on the screen.  The m-file disp1.m allows the
>statement
>   disp1('x measures blah blah, its value is ', x);
>
> [script deleted]

You don't need an m-file for that - just use:

disp(['x measures blah blah, its value is ' num2str(x)]);


--
Rich Pawlowicz ----------------- INTERNET: rich@boreas.whoi.edu
Woods Hole Oceanographic Institution
"Home of the 99 cent squid burger (cheese extra)"
--------------------------------------------------------------
Technical Details
Message-ID: <1993Jan23.233224.11781@netnews.whoi.edu>
Path: arc1-ca.pugleaf.net!sparky!uunet!gumby!destroyer!ncar!netnews.whoi.edu!news
References: <1993Jan23.152729.26892@news.columbia.edu>

Show Full Headers
Complete Article Headers
Newsgroups: comp.soft-sys.matlab
Path: arc1-ca.pugleaf.net!sparky!uunet!gumby!destroyer!ncar!netnews.whoi.edu!news
From: rich@boreas.whoi.edu
Subject: Re: DISP1:  disp1.m - display text and numbers 
Message-ID: <1993Jan23.233224.11781@netnews.whoi.edu>
Sender: news@netnews.whoi.edu
Organization: Woods Hole Oceanographic Institution
References: <1993Jan23.152729.26892@news.columbia.edu>
Date: Sat, 23 Jan 93 23:32:24 GMT
Lines: 22