Path: news.mathworks.com!not-for-mail
From: "Steven Lord" <slord@mathworks.com>
Newsgroups: comp.soft-sys.matlab
Subject: Re: pseudo fprintf user defined function
Date: Mon, 9 Nov 2009 09:37:08 -0500
Organization: The MathWorks, Inc.
Lines: 34
Message-ID: <hd99cp$64$1@fred.mathworks.com>
References: <hd82sm$k7t$1@fred.mathworks.com>
Reply-To: "Steven Lord" <slord@mathworks.com>
NNTP-Posting-Host: lords.dhcp.mathworks.com
X-Trace: fred.mathworks.com 1257777369 196 172.31.44.65 (9 Nov 2009 14:36:09 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Mon, 9 Nov 2009 14:36:09 +0000 (UTC)
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.5512
X-RFC2646: Format=Flowed; Original
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5579
Xref: news.mathworks.com comp.soft-sys.matlab:583555



"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