Be the first to rate this file! 1 Download (last 30 days) File Size: 1.29 KB File ID: #21705

DispA(ll)

by Alan Robinson

 

09 Oct 2008 (Updated 16 Feb 2010)

Version of disp that can take any number of arguments

| Watch this File

File Information
Description

Wish disp took more than one argument? Tired of using fprintf to print to the console? Try Dispa('the brightness is', var, 'cd/m2').

Seems like somebody else must have written this before me, but I couldn't find it.

MATLAB release MATLAB 7.3 (R2006b)
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (2)
21 Feb 2010 Oleg Komarov

Don't see why I should be tired of:
>> fprintf('the brightness is %.3f cd/m2 \n',32.098)
the brightness is 32.098 cd/m2

04 Aug 2010 Alan Robinson

I guess it depends on how much you like printf strings. I find them easy to write, but error prone to edit after the fact.

Please login to add a comment or rating.
Updates
24 May 2009

Improved comments, supports string concatenation.

21 Jun 2009

Updated description.

16 Feb 2010

now supports \t and \n style formatting, like printf (in fact, it uses fprintf to output text).

Tag Activity for this File
Tag Applied By Date/Time
strings Alan Robinson 22 Oct 2008 10:23:35
display Alan Robinson 22 Oct 2008 10:23:35
disp Alan Robinson 22 Oct 2008 10:23:35
text Alan Robinson 22 Oct 2008 10:23:35
utilities Alan Robinson 22 Oct 2008 10:23:35
string manipulation Alan Robinson 22 Oct 2008 10:23:35
disp EL N 24 Jun 2009 04:34:19
display EL N 24 Jun 2009 04:34:24

Contact us at files@mathworks.com