<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Class Initialization for Variables</title>
	<atom:link href="http://blogs.mathworks.com/loren/2007/01/05/class-initialization-for-variables/feed/" rel="self" type="application/rss+xml" />
	<link>http://blogs.mathworks.com/loren/2007/01/05/class-initialization-for-variables/</link>
	<description>Loren Shure works on design of the MATLAB language at MathWorks. She writes here about once a week on MATLAB programming and related topics.</description>
	<lastBuildDate>Thu, 09 Feb 2012 04:19:21 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
	<item>
		<title>By: Loren</title>
		<link>http://blogs.mathworks.com/loren/2007/01/05/class-initialization-for-variables/#comment-25516</link>
		<dc:creator>Loren</dc:creator>
		<pubDate>Tue, 29 Jan 2008 12:50:43 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.mathworks.com/loren/?p=72#comment-25516</guid>
		<description>Martin-


Please contact tehcnical support for your issue.

--Loren</description>
		<content:encoded><![CDATA[<p>Martin-</p>
<p>Please contact tehcnical support for your issue.</p>
<p>&#8211;Loren</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Martin</title>
		<link>http://blogs.mathworks.com/loren/2007/01/05/class-initialization-for-variables/#comment-25508</link>
		<dc:creator>Martin</dc:creator>
		<pubDate>Tue, 29 Jan 2008 09:21:49 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.mathworks.com/loren/?p=72#comment-25508</guid>
		<description>Hi,

I am using Matlab 2007b and get the following error:

Exception in thread &quot;AWT-EventQueue-0&quot; java.lang.OutOfMemoryError: GC overhead limit exceeded.
And another one concerning java-heapspace.
There is no bug in the program, since on a linux-workstation it works well. But on a plain Windows machine (java 1.5 / 1.6) I get this messages.
How do I handel java memory issues under Matlab 7.5 ??

Thanks a lot.</description>
		<content:encoded><![CDATA[<p>Hi,</p>
<p>I am using Matlab 2007b and get the following error:</p>
<p>Exception in thread &#8220;AWT-EventQueue-0&#8243; java.lang.OutOfMemoryError: GC overhead limit exceeded.<br />
And another one concerning java-heapspace.<br />
There is no bug in the program, since on a linux-workstation it works well. But on a plain Windows machine (java 1.5 / 1.6) I get this messages.<br />
How do I handel java memory issues under Matlab 7.5 ??</p>
<p>Thanks a lot.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Loren</title>
		<link>http://blogs.mathworks.com/loren/2007/01/05/class-initialization-for-variables/#comment-22126</link>
		<dc:creator>Loren</dc:creator>
		<pubDate>Mon, 26 Nov 2007 14:13:19 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.mathworks.com/loren/?p=72#comment-22126</guid>
		<description>Martin-

The short answer is, not easily.  persistent requires variable and n.Input is a temporary variable since it is a field in a struct or object.   You could have a persistent variable in your constructor and then assign its value to a field in the object.  Or you could have some state in your object by storing your &quot;persistent&quot; variable in the constructor where the constructor uses nested functions to preserve state.  There is a relatively new example on the File Exchange that does something similar: http://www.mathworks.com/matlabcentral/fileexchange/loadFile.do?objectId=17240&amp;objectType=FILE

--Loren</description>
		<content:encoded><![CDATA[<p>Martin-</p>
<p>The short answer is, not easily.  persistent requires variable and n.Input is a temporary variable since it is a field in a struct or object.   You could have a persistent variable in your constructor and then assign its value to a field in the object.  Or you could have some state in your object by storing your &#8220;persistent&#8221; variable in the constructor where the constructor uses nested functions to preserve state.  There is a relatively new example on the File Exchange that does something similar: <a href="http://www.mathworks.com/matlabcentral/fileexchange/loadFile.do?objectId=17240&#038;objectType=FILE" rel="nofollow">http://www.mathworks.com/matlabcentral/fileexchange/loadFile.do?objectId=17240&#038;objectType=FILE</a></p>
<p>&#8211;Loren</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Martin</title>
		<link>http://blogs.mathworks.com/loren/2007/01/05/class-initialization-for-variables/#comment-22125</link>
		<dc:creator>Martin</dc:creator>
		<pubDate>Mon, 26 Nov 2007 14:07:05 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.mathworks.com/loren/?p=72#comment-22125</guid>
		<description>Hi,

is there a way to work with variables that belong to a class rather than to an instance of a class ?
In Java I would write &quot;private static&quot; inside the class definition. I tried it with &quot;persistent&quot;, but Matlab doesnt like constructions like: &quot;persistent n.Input&quot; e.g. inside the constructor with n being my object.


Thanks for your help,
 Martin.</description>
		<content:encoded><![CDATA[<p>Hi,</p>
<p>is there a way to work with variables that belong to a class rather than to an instance of a class ?<br />
In Java I would write &#8220;private static&#8221; inside the class definition. I tried it with &#8220;persistent&#8221;, but Matlab doesnt like constructions like: &#8220;persistent n.Input&#8221; e.g. inside the constructor with n being my object.</p>
<p>Thanks for your help,<br />
 Martin.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Loren</title>
		<link>http://blogs.mathworks.com/loren/2007/01/05/class-initialization-for-variables/#comment-16327</link>
		<dc:creator>Loren</dc:creator>
		<pubDate>Tue, 31 Jul 2007 11:15:39 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.mathworks.com/loren/?p=72#comment-16327</guid>
		<description>Aliza,

You&#039;d be better off contacting technical support for issues about Simulink.   Here&#039;s the link:

http://www.mathworks.com/support/service_requests/contact_support.do

--Loren</description>
		<content:encoded><![CDATA[<p>Aliza,</p>
<p>You&#8217;d be better off contacting technical support for issues about Simulink.   Here&#8217;s the link:</p>
<p><a href="http://www.mathworks.com/support/service_requests/contact_support.do" rel="nofollow">http://www.mathworks.com/support/service_requests/contact_support.do</a></p>
<p>&#8211;Loren</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Aliza</title>
		<link>http://blogs.mathworks.com/loren/2007/01/05/class-initialization-for-variables/#comment-16326</link>
		<dc:creator>Aliza</dc:creator>
		<pubDate>Mon, 30 Jul 2007 22:53:16 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.mathworks.com/loren/?p=72#comment-16326</guid>
		<description>Hi, 
I am using simulink-embedded RTW - Tornado, and my target is a power PC. Up to now i&#039;ve used the software emulation to generate the math for simulink&#039;s default double signals. But we&#039;ve come up with execution time problems. 
For this reason we&#039;ve switched to the hardware ALU for math computations. The problem is, it can only work with single-precision signals. 
Do you know of any way to create a totally single float model (including, for instance, the use of sinf rather than sin that works only on doubles etc.)?
I have been having much difficulty with this issue and would greatly appreciate the help.
Thank you, 
Aliza</description>
		<content:encoded><![CDATA[<p>Hi,<br />
I am using simulink-embedded RTW &#8211; Tornado, and my target is a power PC. Up to now i&#8217;ve used the software emulation to generate the math for simulink&#8217;s default double signals. But we&#8217;ve come up with execution time problems.<br />
For this reason we&#8217;ve switched to the hardware ALU for math computations. The problem is, it can only work with single-precision signals.<br />
Do you know of any way to create a totally single float model (including, for instance, the use of sinf rather than sin that works only on doubles etc.)?<br />
I have been having much difficulty with this issue and would greatly appreciate the help.<br />
Thank you,<br />
Aliza</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Darius</title>
		<link>http://blogs.mathworks.com/loren/2007/01/05/class-initialization-for-variables/#comment-16021</link>
		<dc:creator>Darius</dc:creator>
		<pubDate>Thu, 18 Jan 2007 09:14:57 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.mathworks.com/loren/?p=72#comment-16021</guid>
		<description>interesting

------------------
http://privacy.emigrantas.com - all about privacy in the Internet</description>
		<content:encoded><![CDATA[<p>interesting</p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br />
<a href="http://privacy.emigrantas.com" rel="nofollow">http://privacy.emigrantas.com</a> &#8211; all about privacy in the Internet</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Loren</title>
		<link>http://blogs.mathworks.com/loren/2007/01/05/class-initialization-for-variables/#comment-16017</link>
		<dc:creator>Loren</dc:creator>
		<pubDate>Wed, 10 Jan 2007 17:55:54 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.mathworks.com/loren/?p=72#comment-16017</guid>
		<description>Dan-

Here&#039;s a quick anonymous function:

c1contents = @(c) c{1}

&lt;pre&gt;
&gt;&gt; s = {&#039;fred&#039;}
s = 
    &#039;fred&#039;
&gt;&gt; c1contents(s)
ans =
fred
&gt;&gt; c1contents({2})
ans =
     2
&gt;&gt; c1contents({1 4 17})
ans =
     1
&lt;/pre&gt;

--Loren</description>
		<content:encoded><![CDATA[<p>Dan-</p>
<p>Here&#8217;s a quick anonymous function:</p>
<p>c1contents = @(c) c{1}</p>
<pre>
>> s = {'fred'}
s =
    'fred'
>> c1contents(s)
ans =
fred
>> c1contents({2})
ans =
     2
>> c1contents({1 4 17})
ans =
     1
</pre>
<p>&#8211;Loren</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dan K</title>
		<link>http://blogs.mathworks.com/loren/2007/01/05/class-initialization-for-variables/#comment-16016</link>
		<dc:creator>Dan K</dc:creator>
		<pubDate>Wed, 10 Jan 2007 13:47:37 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.mathworks.com/loren/?p=72#comment-16016</guid>
		<description>Loren,
Yes, it does help in at least some cases.  On the other hand it might be nice to have a command which easily extracts the contents of singleton cell arrays.  Maybe in R2008 : )</description>
		<content:encoded><![CDATA[<p>Loren,<br />
Yes, it does help in at least some cases.  On the other hand it might be nice to have a command which easily extracts the contents of singleton cell arrays.  Maybe in R2008 : )</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Loren</title>
		<link>http://blogs.mathworks.com/loren/2007/01/05/class-initialization-for-variables/#comment-16013</link>
		<dc:creator>Loren</dc:creator>
		<pubDate>Mon, 08 Jan 2007 15:29:28 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.mathworks.com/loren/?p=72#comment-16013</guid>
		<description>Dan-

You could use char() if you know A is a single string, either in a cell or not.  But it doesn&#039;t work for numeric types.  Would that help?

--Loren</description>
		<content:encoded><![CDATA[<p>Dan-</p>
<p>You could use char() if you know A is a single string, either in a cell or not.  But it doesn&#8217;t work for numeric types.  Would that help?</p>
<p>&#8211;Loren</p>
]]></content:encoded>
	</item>
</channel>
</rss>

