<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/265324</link>
    <title>MATLAB Central Newsreader - pseudo fprintf user defined function</title>
    <description>Feed for thread: pseudo fprintf user defined function</description>
    <language>en-us</language>
    <copyright>&amp;copy;1994-2012 by MathWorks, Inc.</copyright>
    <webmaster>webmaster@mathworks.com</webmaster>
    <generator>MATLAB Central Newsreader</generator>
    <docs>http://blogs.law.harvard.edu/tech/rss</docs>
    <ttl>60</ttl>
    <image>
      <title>MathWorks</title>
      <url>http://www.mathworks.com/images/membrane_icon.gif</url>
    </image>
    <item>
      <pubDate>Mon, 09 Nov 2009 03:39:02 -0500</pubDate>
      <title>pseudo fprintf user defined function</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/265324#693130</link>
      <author>Wai Kwan </author>
      <description>Hello all,&lt;br&gt;
&lt;br&gt;
I feel bad for asking a silly question here but I am still a freshie on MATLAB.&lt;br&gt;
I am having an assignment from university and apparently I was asked to prepare a new function which is similar to fprintf.&lt;br&gt;
&lt;br&gt;
The function should be able to act like fprintf,just for the string printing part only.&lt;br&gt;
The emulated function should be able to behave differently if you supply return variable&lt;br&gt;
(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').&lt;br&gt;
&lt;br&gt;
I have been stuck for days.Seriously need all of your help A.S.A.P.&lt;br&gt;
Thanks in advance.&lt;br&gt;
&lt;br&gt;
Warmly,&lt;br&gt;
WaiKwan</description>
    </item>
    <item>
      <pubDate>Mon, 09 Nov 2009 07:31:30 -0500</pubDate>
      <title>Re: pseudo fprintf user defined function</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/265324#693148</link>
      <author>TideMan</author>
      <description>On Nov 9, 4:39&#160;pm, &quot;Wai Kwan &quot; &amp;lt;waikwan_...@hotmail.com&amp;gt; wrote:&lt;br&gt;
&amp;gt; Hello all,&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; I feel bad for asking a silly question here but I am still a freshie on MATLAB.&lt;br&gt;
&amp;gt; I am having an assignment from university and apparently I was asked to prepare a new function which is similar to fprintf.&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; The function should be able to act like fprintf,just for the string printing part only.&lt;br&gt;
&amp;gt; The emulated function should be able to behave differently if you supply return variable&lt;br&gt;
&amp;gt; (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').&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; I have been stuck for days.Seriously need all of your help A.S.A.P.&lt;br&gt;
&amp;gt; Thanks in advance.&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; Warmly,&lt;br&gt;
&amp;gt; WaiKwan&lt;br&gt;
&lt;br&gt;
So, what have you tried so far?&lt;br&gt;
Or do you expect us to do your homework for you?&lt;br&gt;
And if we do this, will you submit it and claim it as your own work?&lt;br&gt;
Honestly, I really want to help you, but I'm afraid that if I do so,&lt;br&gt;
that will make you a liar and a cheat.&lt;br&gt;
Perhaps the best thing would be if you posted your professor's email,&lt;br&gt;
then we can submit our solution to your homework directly to him&lt;br&gt;
pointing out the dilemma that we are facing.</description>
    </item>
    <item>
      <pubDate>Mon, 09 Nov 2009 11:34:02 -0500</pubDate>
      <title>Re: pseudo fprintf user defined function</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/265324#693180</link>
      <author>Wai Kwan </author>
      <description>TideMan &amp;lt;mulgor@gmail.com&amp;gt; wrote in message &amp;lt;172f7d91-1f1b-4fcb-bea3-a4cbf034d92f@g1g2000pra.googlegroups.com&amp;gt;...&lt;br&gt;
&amp;gt; On Nov 9, 4:39?pm, &quot;Wai Kwan &quot; &amp;lt;waikwan_...@hotmail.com&amp;gt; wrote:&lt;br&gt;
&amp;gt; &amp;gt; Hello all,&lt;br&gt;
&amp;gt; &amp;gt;&lt;br&gt;
&amp;gt; &amp;gt; I feel bad for asking a silly question here but I am still a freshie on MATLAB.&lt;br&gt;
&amp;gt; &amp;gt; I am having an assignment from university and apparently I was asked to prepare a new function which is similar to fprintf.&lt;br&gt;
&amp;gt; &amp;gt;&lt;br&gt;
&amp;gt; &amp;gt; The function should be able to act like fprintf,just for the string printing part only.&lt;br&gt;
&amp;gt; &amp;gt; The emulated function should be able to behave differently if you supply return variable&lt;br&gt;
&amp;gt; &amp;gt; (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').&lt;br&gt;
&amp;gt; &amp;gt;&lt;br&gt;
&amp;gt; &amp;gt; I have been stuck for days.Seriously need all of your help A.S.A.P.&lt;br&gt;
&amp;gt; &amp;gt; Thanks in advance.&lt;br&gt;
&amp;gt; &amp;gt;&lt;br&gt;
&amp;gt; &amp;gt; Warmly,&lt;br&gt;
&amp;gt; &amp;gt; WaiKwan&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; So, what have you tried so far?&lt;br&gt;
&amp;gt; Or do you expect us to do your homework for you?&lt;br&gt;
&amp;gt; And if we do this, will you submit it and claim it as your own work?&lt;br&gt;
&amp;gt; Honestly, I really want to help you, but I'm afraid that if I do so,&lt;br&gt;
&amp;gt; that will make you a liar and a cheat.&lt;br&gt;
&amp;gt; Perhaps the best thing would be if you posted your professor's email,&lt;br&gt;
&amp;gt; then we can submit our solution to your homework directly to him&lt;br&gt;
&amp;gt; pointing out the dilemma that we are facing.&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; &lt;br&gt;
Hi tideman,&lt;br&gt;
For your first question,I have tried using &quot;char&quot;function and &quot;sprintf&quot;function to print out this string.And I failed to suppress the length of the string as I wish.&lt;br&gt;
2nd question,no i want to do my work my own.&lt;br&gt;
3rd,I am seeking advice here.If I could figure that myself,do I need to post my trouble here?&lt;br&gt;
And thanks for reading my post and take your time replying this.&lt;br&gt;
I sincerely thank you if you wish to care.I also welcome you if you feel like lecturing me.&lt;br&gt;
=)&lt;br&gt;
&lt;br&gt;
WaiKwan</description>
    </item>
    <item>
      <pubDate>Mon, 09 Nov 2009 14:37:08 -0500</pubDate>
      <title>Re: pseudo fprintf user defined function</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/265324#693221</link>
      <author>Steven Lord</author>
      <description>&lt;br&gt;
&quot;Wai Kwan &quot; &amp;lt;waikwan_lim@hotmail.com&amp;gt; wrote in message &lt;br&gt;
news:hd82sm$k7t$1@fred.mathworks.com...&lt;br&gt;
&amp;gt; Hello all,&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; I feel bad for asking a silly question here but I am still a freshie on &lt;br&gt;
&amp;gt; MATLAB.&lt;br&gt;
&amp;gt; I am having an assignment from university and apparently I was asked to &lt;br&gt;
&amp;gt; prepare a new function which is similar to fprintf.&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; The function should be able to act like fprintf,just for the string &lt;br&gt;
&amp;gt; printing part only.&lt;br&gt;
&amp;gt; The emulated function should be able to behave differently if you supply &lt;br&gt;
&amp;gt; return variable&lt;br&gt;
&amp;gt; (ret = fprintf('hi') % prints `hi' and assign 2 to variable ret) and if &lt;br&gt;
&amp;gt; you do not supply such return variable (fprintf('hi') % just prints `hi').&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; I have been stuck for days.Seriously need all of your help A.S.A.P.&lt;br&gt;
&amp;gt; Thanks in advance.&lt;br&gt;
&lt;br&gt;
We'd like to help you, but you didn't actually ask a question in this &lt;br&gt;
posting ... if you ask a question about a specific section of the code &lt;br&gt;
you've written and show us that code, it's much more likely that we'll &lt;br&gt;
actually be able to help you.&lt;br&gt;
&lt;br&gt;
As a guess, I suspect you're not sure how to differentiate between the &lt;br&gt;
output argument/no output argument cases.  If so, look at HELP NARGOUT.&lt;br&gt;
&lt;br&gt;
-- &lt;br&gt;
Steve Lord&lt;br&gt;
slord@mathworks.com&lt;br&gt;
comp.soft-sys.matlab (CSSM) FAQ: &lt;a href=&quot;http://matlabwiki.mathworks.com/MATLAB_FAQ&quot;&gt;http://matlabwiki.mathworks.com/MATLAB_FAQ&lt;/a&gt; </description>
    </item>
    <item>
      <pubDate>Tue, 10 Nov 2009 03:14:01 -0500</pubDate>
      <title>Re: pseudo fprintf user defined function</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/265324#693385</link>
      <author>Wai Kwan </author>
      <description>&quot;Steven Lord&quot; &amp;lt;slord@mathworks.com&amp;gt; wrote in message &amp;lt;hd99cp$64$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; &quot;Wai Kwan &quot; &amp;lt;waikwan_lim@hotmail.com&amp;gt; wrote in message &lt;br&gt;
&amp;gt; news:hd82sm$k7t$1@fred.mathworks.com...&lt;br&gt;
&amp;gt; &amp;gt; Hello all,&lt;br&gt;
&amp;gt; &amp;gt;&lt;br&gt;
&amp;gt; &amp;gt; I feel bad for asking a silly question here but I am still a freshie on &lt;br&gt;
&amp;gt; &amp;gt; MATLAB.&lt;br&gt;
&amp;gt; &amp;gt; I am having an assignment from university and apparently I was asked to &lt;br&gt;
&amp;gt; &amp;gt; prepare a new function which is similar to fprintf.&lt;br&gt;
&amp;gt; &amp;gt;&lt;br&gt;
&amp;gt; &amp;gt; The function should be able to act like fprintf,just for the string &lt;br&gt;
&amp;gt; &amp;gt; printing part only.&lt;br&gt;
&amp;gt; &amp;gt; The emulated function should be able to behave differently if you supply &lt;br&gt;
&amp;gt; &amp;gt; return variable&lt;br&gt;
&amp;gt; &amp;gt; (ret = fprintf('hi') % prints `hi' and assign 2 to variable ret) and if &lt;br&gt;
&amp;gt; &amp;gt; you do not supply such return variable (fprintf('hi') % just prints `hi').&lt;br&gt;
&amp;gt; &amp;gt;&lt;br&gt;
&amp;gt; &amp;gt; I have been stuck for days.Seriously need all of your help A.S.A.P.&lt;br&gt;
&amp;gt; &amp;gt; Thanks in advance.&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; We'd like to help you, but you didn't actually ask a question in this &lt;br&gt;
&amp;gt; posting ... if you ask a question about a specific section of the code &lt;br&gt;
&amp;gt; you've written and show us that code, it's much more likely that we'll &lt;br&gt;
&amp;gt; actually be able to help you.&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; As a guess, I suspect you're not sure how to differentiate between the &lt;br&gt;
&amp;gt; output argument/no output argument cases.  If so, look at HELP NARGOUT.&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; -- &lt;br&gt;
&amp;gt; Steve Lord&lt;br&gt;
&amp;gt; slord@mathworks.com&lt;br&gt;
&amp;gt; comp.soft-sys.matlab (CSSM) FAQ: &lt;a href=&quot;http://matlabwiki.mathworks.com/MATLAB_FAQ&quot;&gt;http://matlabwiki.mathworks.com/MATLAB_FAQ&lt;/a&gt; &lt;br&gt;
&amp;gt; &lt;br&gt;
Hi Steven,&lt;br&gt;
&lt;br&gt;
Thanks for the reminder on nargout function part. Using this method,I did solve my problem.&lt;br&gt;
Thanks again for the guidance. =)&lt;br&gt;
&lt;br&gt;
WaiKwan</description>
    </item>
  </channel>
</rss>

