<?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: Setting class property types	</title>
	<atom:link href="https://undocumentedmatlab.com/articles/setting-class-property-types/feed" rel="self" type="application/rss+xml" />
	<link>https://undocumentedmatlab.com/articles/setting-class-property-types?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=setting-class-property-types</link>
	<description>Professional Matlab consulting, development and training</description>
	<lastBuildDate>Wed, 07 Feb 2024 14:51:52 +0000</lastBuildDate>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.7.2</generator>
	<item>
		<title>
		By: Bamby1313		</title>
		<link>https://undocumentedmatlab.com/articles/setting-class-property-types#comment-523565</link>

		<dc:creator><![CDATA[Bamby1313]]></dc:creator>
		<pubDate>Wed, 07 Feb 2024 14:51:52 +0000</pubDate>
		<guid isPermaLink="false">http://undocumentedmatlab.com/?p=3725#comment-523565</guid>

					<description><![CDATA[Now you can use arguments validation block
&lt;pre lang=&quot;matlab&quot;&gt;
function output = myFunction(input1,input2)
  arguments (Input)
    input1 double {mustBeLessThan(input1,10)} = 5
    input2 double {mustBeGreaterThan(input2,1)} = 2
  end
  arguments (Output)
    output integer
  end
  output = input1 + input2;
  output = int(output);
end
&lt;/pre&gt;]]></description>
			<content:encoded><![CDATA[<p>Now you can use arguments validation block</p>
<pre lang="matlab">
function output = myFunction(input1,input2)
  arguments (Input)
    input1 double {mustBeLessThan(input1,10)} = 5
    input2 double {mustBeGreaterThan(input2,1)} = 2
  end
  arguments (Output)
    output integer
  end
  output = input1 + input2;
  output = int(output);
end
</pre>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Yair Altman		</title>
		<link>https://undocumentedmatlab.com/articles/setting-class-property-types#comment-515245</link>

		<dc:creator><![CDATA[Yair Altman]]></dc:creator>
		<pubDate>Fri, 30 Sep 2022 14:53:02 +0000</pubDate>
		<guid isPermaLink="false">http://undocumentedmatlab.com/?p=3725#comment-515245</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://undocumentedmatlab.com/articles/setting-class-property-types#comment-515244&quot;&gt;Jeremiah Sullivan&lt;/a&gt;.

Starting in R2022b the legacy @ syntax has changed from a warning to an error. Classes that use the legacy syntax generate a run-time error and no longer run.]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://undocumentedmatlab.com/articles/setting-class-property-types#comment-515244">Jeremiah Sullivan</a>.</p>
<p>Starting in R2022b the legacy @ syntax has changed from a warning to an error. Classes that use the legacy syntax generate a run-time error and no longer run.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Jeremiah Sullivan		</title>
		<link>https://undocumentedmatlab.com/articles/setting-class-property-types#comment-515244</link>

		<dc:creator><![CDATA[Jeremiah Sullivan]]></dc:creator>
		<pubDate>Fri, 30 Sep 2022 13:50:33 +0000</pubDate>
		<guid isPermaLink="false">http://undocumentedmatlab.com/?p=3725#comment-515244</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://undocumentedmatlab.com/articles/setting-class-property-types#comment-507980&quot;&gt;Wil Koenen&lt;/a&gt;.

For what its worth, I am still getting that same &quot;undocumented syntax&quot; warning in 2022a. I really hope they don&#039;t create another breaking change...]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://undocumentedmatlab.com/articles/setting-class-property-types#comment-507980">Wil Koenen</a>.</p>
<p>For what its worth, I am still getting that same &#8220;undocumented syntax&#8221; warning in 2022a. I really hope they don&#8217;t create another breaking change&#8230;</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Wil Koenen		</title>
		<link>https://undocumentedmatlab.com/articles/setting-class-property-types#comment-507980</link>

		<dc:creator><![CDATA[Wil Koenen]]></dc:creator>
		<pubDate>Thu, 05 Dec 2019 12:30:03 +0000</pubDate>
		<guid isPermaLink="false">http://undocumentedmatlab.com/?p=3725#comment-507980</guid>

					<description><![CDATA[The undocumented syntax, e.g.
&lt;pre lang=&quot;matlab&quot;&gt;
classdef MyClass
    properties
        prop@double scalar = 3;
    end
end
&lt;/pre&gt;
runs fine in R2019a, but produces a warning in R2019b:
&lt;pre lang=&quot;text&quot;&gt;
Warning: Class &#039;MyClass&#039; uses an undocumented syntax to restrict property values. 
Use property validation syntax instead. This warning will become an error in a future release.
&lt;/pre&gt;]]></description>
			<content:encoded><![CDATA[<p>The undocumented syntax, e.g.</p>
<pre lang="matlab">
classdef MyClass
    properties
        prop@double scalar = 3;
    end
end
</pre>
<p>runs fine in R2019a, but produces a warning in R2019b:</p>
<pre lang="text">
Warning: Class 'MyClass' uses an undocumented syntax to restrict property values. 
Use property validation syntax instead. This warning will become an error in a future release.
</pre>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Yair Altman		</title>
		<link>https://undocumentedmatlab.com/articles/setting-class-property-types#comment-392100</link>

		<dc:creator><![CDATA[Yair Altman]]></dc:creator>
		<pubDate>Mon, 31 Oct 2016 22:19:23 +0000</pubDate>
		<guid isPermaLink="false">http://undocumentedmatlab.com/?p=3725#comment-392100</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://undocumentedmatlab.com/articles/setting-class-property-types#comment-392087&quot;&gt;Marshall&lt;/a&gt;.

@Marshall - perhaps you can create a new class that inherits &lt;code&gt;Simulink.ConfigSet&lt;/code&gt; and adds nothing to it, whose only benefit is the fact that it does not have a dot in its class name:
&lt;pre lang=&quot;matlab&quot;&gt;
classdef Simulink_ConfigSet &lt; Simulink.ConfigSet
end
&lt;/pre&gt;
Then you can simply use the new class name:
&lt;pre lang=&quot;matlab&quot;&gt;
configset@Simulink_ConfigSet scalar
&lt;/pre&gt;]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://undocumentedmatlab.com/articles/setting-class-property-types#comment-392087">Marshall</a>.</p>
<p>@Marshall &#8211; perhaps you can create a new class that inherits <code>Simulink.ConfigSet</code> and adds nothing to it, whose only benefit is the fact that it does not have a dot in its class name:</p>
<pre lang="matlab">
classdef Simulink_ConfigSet < Simulink.ConfigSet
end
</pre>
<p>Then you can simply use the new class name:</p>
<pre lang="matlab">
configset@Simulink_ConfigSet scalar
</pre>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Marshall		</title>
		<link>https://undocumentedmatlab.com/articles/setting-class-property-types#comment-392087</link>

		<dc:creator><![CDATA[Marshall]]></dc:creator>
		<pubDate>Mon, 31 Oct 2016 17:44:04 +0000</pubDate>
		<guid isPermaLink="false">http://undocumentedmatlab.com/?p=3725#comment-392087</guid>

					<description><![CDATA[Is there a way to specify that a property must be of a subclass type? For example, the following is not allowed:

&lt;pre lang=&quot;matlab&quot;&gt;configset@Simulink.ConfigSet scalar;&lt;/pre&gt;

The &#039;.&#039; in there messes up the syntax parser, and I can&#039;t figure out how to get around this.]]></description>
			<content:encoded><![CDATA[<p>Is there a way to specify that a property must be of a subclass type? For example, the following is not allowed:</p>
<pre lang="matlab">configset@Simulink.ConfigSet scalar;</pre>
<p>The &#8216;.&#8217; in there messes up the syntax parser, and I can&#8217;t figure out how to get around this.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Adam Gogacz		</title>
		<link>https://undocumentedmatlab.com/articles/setting-class-property-types#comment-375681</link>

		<dc:creator><![CDATA[Adam Gogacz]]></dc:creator>
		<pubDate>Wed, 04 May 2016 13:34:18 +0000</pubDate>
		<guid isPermaLink="false">http://undocumentedmatlab.com/?p=3725#comment-375681</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://undocumentedmatlab.com/articles/setting-class-property-types#comment-374984&quot;&gt;Adam Gogacz&lt;/a&gt;.

I agree with your point. I can think of many simple solutions to type-specification without breaking users&#039; code all the while sticking to the convention of having the type to the left of the variable. For example, specifying the type in brackets to the left of the property (i.e.  myProp), or a thousand other ways. Another lacking feature is the ability to specify type when adding a property dynamically via &quot;addprop&quot;.]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://undocumentedmatlab.com/articles/setting-class-property-types#comment-374984">Adam Gogacz</a>.</p>
<p>I agree with your point. I can think of many simple solutions to type-specification without breaking users&#8217; code all the while sticking to the convention of having the type to the left of the variable. For example, specifying the type in brackets to the left of the property (i.e.  myProp), or a thousand other ways. Another lacking feature is the ability to specify type when adding a property dynamically via &#8220;addprop&#8221;.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Yair Altman		</title>
		<link>https://undocumentedmatlab.com/articles/setting-class-property-types#comment-375151</link>

		<dc:creator><![CDATA[Yair Altman]]></dc:creator>
		<pubDate>Wed, 27 Apr 2016 20:24:20 +0000</pubDate>
		<guid isPermaLink="false">http://undocumentedmatlab.com/?p=3725#comment-375151</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://undocumentedmatlab.com/articles/setting-class-property-types#comment-374984&quot;&gt;Adam Gogacz&lt;/a&gt;.

@Adam - see my response in detail here: http://undocumentedmatlab.com/blog/setting-class-property-types-2]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://undocumentedmatlab.com/articles/setting-class-property-types#comment-374984">Adam Gogacz</a>.</p>
<p>@Adam &#8211; see my response in detail here: <a href="http://undocumentedmatlab.com/blog/setting-class-property-types-2" rel="ugc">http://undocumentedmatlab.com/blog/setting-class-property-types-2</a></p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Adam Gogacz		</title>
		<link>https://undocumentedmatlab.com/articles/setting-class-property-types#comment-374984</link>

		<dc:creator><![CDATA[Adam Gogacz]]></dc:creator>
		<pubDate>Sun, 24 Apr 2016 11:18:19 +0000</pubDate>
		<guid isPermaLink="false">http://undocumentedmatlab.com/?p=3725#comment-374984</guid>

					<description><![CDATA[Thanks for this Yair. I&#039;ve used this approach in the past. However, as of 2016a MATLAB has a documented way of casting the property value.

http://www.mathworks.com/help/matlab/matlab_oop/defining-properties.html]]></description>
			<content:encoded><![CDATA[<p>Thanks for this Yair. I&#8217;ve used this approach in the past. However, as of 2016a MATLAB has a documented way of casting the property value.</p>
<p><a href="http://www.mathworks.com/help/matlab/matlab_oop/defining-properties.html" rel="nofollow ugc">http://www.mathworks.com/help/matlab/matlab_oop/defining-properties.html</a></p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Yair Altman		</title>
		<link>https://undocumentedmatlab.com/articles/setting-class-property-types#comment-362431</link>

		<dc:creator><![CDATA[Yair Altman]]></dc:creator>
		<pubDate>Tue, 24 Nov 2015 13:18:57 +0000</pubDate>
		<guid isPermaLink="false">http://undocumentedmatlab.com/?p=3725#comment-362431</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://undocumentedmatlab.com/articles/setting-class-property-types#comment-362420&quot;&gt;PYC&lt;/a&gt;.

Simply add the &quot;complex&quot; attribute:

&lt;pre lang=&#039;matlab&#039;&gt;
classdef test_mcos
    properties
        value@double scalar complex = 1 + 2i
    end
end

&gt;&gt; t = test_mcos
t = 
  test_mcos with properties:
    value: 1 +    2i
&lt;/pre&gt;]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://undocumentedmatlab.com/articles/setting-class-property-types#comment-362420">PYC</a>.</p>
<p>Simply add the &#8220;complex&#8221; attribute:</p>
<pre lang='matlab'>
classdef test_mcos
    properties
        value@double scalar complex = 1 + 2i
    end
end

>> t = test_mcos
t = 
  test_mcos with properties:
    value: 1 +    2i
</pre>
]]></content:encoded>
		
			</item>
	</channel>
</rss>
