Path: news.mathworks.com!not-for-mail
From: "Wai Kwan " <waikwan_lim@hotmail.com>
Newsgroups: comp.soft-sys.matlab
Subject: pseudo fprintf user defined function
Date: Mon, 9 Nov 2009 03:39:02 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 14
Message-ID: <hd82sm$k7t$1@fred.mathworks.com>
Reply-To: "Wai Kwan " <waikwan_lim@hotmail.com>
NNTP-Posting-Host: webapp-03-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1257737942 20733 172.30.248.38 (9 Nov 2009 03:39:02 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Mon, 9 Nov 2009 03:39:02 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 2083526
Xref: news.mathworks.com comp.soft-sys.matlab:583464


Hello all,

I feel bad for asking a silly question here but I am still a freshie on MATLAB.
I am having an assignment from university and apparently I was asked to prepare a new function which is similar to fprintf.

The function should be able to act like fprintf,just for the string printing part only.
The emulated function should be able to behave differently if you supply return variable
(ret = fprintf('hi') % prints `hi' and assign 2 to variable ret) and if you do not supply such return variable (fprintf('hi') % just prints `hi').

I have been stuck for days.Seriously need all of your help A.S.A.P.
Thanks in advance.

Warmly,
WaiKwan