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


"Steven Lord" <slord@mathworks.com> wrote in message <hd99cp$64$1@fred.mathworks.com>...
> 
> "Wai Kwan " <waikwan_lim@hotmail.com> wrote in message 
> news:hd82sm$k7t$1@fred.mathworks.com...
> > 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.
> 
> We'd like to help you, but you didn't actually ask a question in this 
> posting ... if you ask a question about a specific section of the code 
> you've written and show us that code, it's much more likely that we'll 
> actually be able to help you.
> 
> As a guess, I suspect you're not sure how to differentiate between the 
> output argument/no output argument cases.  If so, look at HELP NARGOUT.
> 
> -- 
> Steve Lord
> slord@mathworks.com
> comp.soft-sys.matlab (CSSM) FAQ: http://matlabwiki.mathworks.com/MATLAB_FAQ 
> 
Hi Steven,

Thanks for the reminder on nargout function part. Using this method,I did solve my problem.
Thanks again for the guidance. =)

WaiKwan