Article View: comp.soft-sys.matlab
Article #46Re: DISP1: disp1.m - display text and numbers
From: Jeffrey A. Beck
Date: Mon, 25 Jan 1993 10:36
Date: Mon, 25 Jan 1993 10:36
28 lines
1843 bytes
1843 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);
>
>Keep these submissions coming!
>
>-mark broadie
Mark,
Try: disp(sprintf('x measures blah blah, it's value is %g',x))
It works on the PC version 3.5 I'm using.
Jeff
------------------------------------------------------------------------
JEFFREY A. BECK, Capt, USAF | ___/ __ __/ __ __/
Doctoral Student / | / / /
Dept of Aeronautics and Astronautics __ | __/ / /
Air Force Institute of Technology __/ __| __/ ______/ __/
------------------------------------------------------------------------
INTERNET: jbeck@afit.af.mil COMPUSERVE: 71371,260
------------------------------------------------------------------------
Technical Details
Message-ID:
<1993Jan25.103610.12912@afit.af.mil>Path:
arc1-ca.pugleaf.net!sparky!uunet!zaphod.mps.ohio-state.edu!magnus.acs.ohio-state.edu!cis.ohio-state.edu!udecc.engr.udayton.edu!blackbird.afit.af.mil!jbeckReferences:
<1993Jan23.152729.26892@news.columbia.edu>Show Full Headers
Complete Article Headers
Newsgroups: comp.soft-sys.matlab Path: arc1-ca.pugleaf.net!sparky!uunet!zaphod.mps.ohio-state.edu!magnus.acs.ohio-state.edu!cis.ohio-state.edu!udecc.engr.udayton.edu!blackbird.afit.af.mil!jbeck From: jbeck@afit.af.mil (Jeffrey A. Beck) Subject: Re: DISP1: disp1.m - display text and numbers Message-ID: <1993Jan25.103610.12912@afit.af.mil> Sender: jbeck@afit.af.mil (Jeffrey A. Beck) Nntp-Posting-Host: wb16.afit.af.mil Organization: Air Force Institute of Technology References: <1993Jan23.152729.26892@news.columbia.edu> Date: Mon, 25 Jan 1993 10:36:10 GMT Lines: 28