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: Mon, 9 Nov 2009 11:34:02 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 36
Message-ID: <hd8una$puh$1@fred.mathworks.com>
References: <hd82sm$k7t$1@fred.mathworks.com> <172f7d91-1f1b-4fcb-bea3-a4cbf034d92f@g1g2000pra.googlegroups.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 1257766442 26577 172.30.248.38 (9 Nov 2009 11:34:02 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Mon, 9 Nov 2009 11:34:02 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 2083526
Xref: news.mathworks.com comp.soft-sys.matlab:583514


TideMan <mulgor@gmail.com> wrote in message <172f7d91-1f1b-4fcb-bea3-a4cbf034d92f@g1g2000pra.googlegroups.com>...
> On Nov 9, 4:39?pm, "Wai Kwan " <waikwan_...@hotmail.com> wrote:
> > 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
> 
> So, what have you tried so far?
> Or do you expect us to do your homework for you?
> And if we do this, will you submit it and claim it as your own work?
> Honestly, I really want to help you, but I'm afraid that if I do so,
> that will make you a liar and a cheat.
> Perhaps the best thing would be if you posted your professor's email,
> then we can submit our solution to your homework directly to him
> pointing out the dilemma that we are facing.
> 
> 
Hi tideman,
For your first question,I have tried using "char"function and "sprintf"function to print out this string.And I failed to suppress the length of the string as I wish.
2nd question,no i want to do my work my own.
3rd,I am seeking advice here.If I could figure that myself,do I need to post my trouble here?
And thanks for reading my post and take your time replying this.
I sincerely thank you if you wish to care.I also welcome you if you feel like lecturing me.
=)

WaiKwan