<?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: Dynamic Mask Dialogs</title>
	<atom:link href="http://blogs.mathworks.com/seth/2008/08/13/dynamic-mask-dialogs/feed/" rel="self" type="application/rss+xml" />
	<link>http://blogs.mathworks.com/seth/2008/08/13/dynamic-mask-dialogs/</link>
	<description>This blog is about Simulink.</description>
	<lastBuildDate>Fri, 10 Feb 2012 13:23:56 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
	<item>
		<title>By: rf</title>
		<link>http://blogs.mathworks.com/seth/2008/08/13/dynamic-mask-dialogs/#comment-1625</link>
		<dc:creator>rf</dc:creator>
		<pubDate>Fri, 25 Nov 2011 07:27:43 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.mathworks.com/seth/2008/08/13/dynamic-mask-dialogs/#comment-1625</guid>
		<description>hi
i am trying to change a subsystem using. edit mask/parameters.
when i use parameters and define a new one, i find out that when choose pop up type for a parameter that describes a value of a contsant block, the result of contstant block is an order number. for example when i mask a parameter &#039;b&#039; by pop up values of 5 8 12 13 15 when i choose value as 5 output is 1, when 8 is choosed output is 2 etc.
what can i do to resolve this problem?
thanks</description>
		<content:encoded><![CDATA[<p>hi<br />
i am trying to change a subsystem using. edit mask/parameters.<br />
when i use parameters and define a new one, i find out that when choose pop up type for a parameter that describes a value of a contsant block, the result of contstant block is an order number. for example when i mask a parameter &#8216;b&#8217; by pop up values of 5 8 12 13 15 when i choose value as 5 output is 1, when 8 is choosed output is 2 etc.<br />
what can i do to resolve this problem?<br />
thanks</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Thomas Weustenfeld</title>
		<link>http://blogs.mathworks.com/seth/2008/08/13/dynamic-mask-dialogs/#comment-1542</link>
		<dc:creator>Thomas Weustenfeld</dc:creator>
		<pubDate>Wed, 03 Aug 2011 12:12:30 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.mathworks.com/seth/2008/08/13/dynamic-mask-dialogs/#comment-1542</guid>
		<description>@Alex: The following works for me. Note the explicitly replaced delimiter, which is 124. Otherwise it won&#039;t work, Simulink doesn&#039;t allow that you put a &#039;&#124;&#039; in your code.

&lt;pre&gt;
styles = get_param(gcb,&#039;MaskStyles&#039;);
str = &#039;&#039;;
files = dir(&#039;characteristics/*.m&#039;);
for f=files&#039;; str = [str 124 f.name]; end
styles{1} = [&#039;popup(&#039; str(2:end) &#039;)&#039;];
set_param(gcb,&#039;MaskStyles&#039;, styles);
&lt;/pre&gt;

In this example a popup list at position 1 is created from all m-files found in a certain folder.

Regards
Thomas</description>
		<content:encoded><![CDATA[<p>@Alex: The following works for me. Note the explicitly replaced delimiter, which is 124. Otherwise it won&#8217;t work, Simulink doesn&#8217;t allow that you put a &#8216;|&#8217; in your code.</p>
<pre>
styles = get_param(gcb,'MaskStyles');
str = '';
files = dir('characteristics/*.m');
for f=files'; str = [str 124 f.name]; end
styles{1} = ['popup(' str(2:end) ')'];
set_param(gcb,'MaskStyles', styles);
</pre>
<p>In this example a popup list at position 1 is created from all m-files found in a certain folder.</p>
<p>Regards<br />
Thomas</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: João Esquecido</title>
		<link>http://blogs.mathworks.com/seth/2008/08/13/dynamic-mask-dialogs/#comment-1329</link>
		<dc:creator>João Esquecido</dc:creator>
		<pubDate>Tue, 11 Jan 2011 14:43:10 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.mathworks.com/seth/2008/08/13/dynamic-mask-dialogs/#comment-1329</guid>
		<description>Is there a way to dynamically change popup menu options of a mask dialog based on parameters of the same mask while it is open and without being forced to close by MATLAB? I have a mask which has 3 parameters:

1) An edit box where I write the name of a MATLAB structure (e.g. MyStruct). This structure has a number of fields which are, in turn, structures with a number of other fields. For example I have a structure named MyStruct with:
MyStruct.Field_A = struct(&#039;SubField_A1&#039;,[],&#039;SubField_A2&#039;,[])
MyStruct.Field_B = struct(&#039;SubField_B1&#039;,[],&#039;SubField_B2&#039;,[])

2) A popup menu which I want to include as options the names of the fields of the structure in the first parameter (i.e., fieldnames(MyStruct) in this example);

3) A popup menu which I want to include as options the names of the sub-fields of the structure MyStruct.(FieldName), where FieldName is the field name selected in the previous popup menu (i.e. fieldnames(MyStruct.(FieldName))

I have code to do this (using the parameter callback functions of parameters 1) and 2)) but each time I maque a selection of parameter 2) that changes the contents of the options of parameter 3) MATLAB closes the mask dialog and issues the following warning:

Warning: The dialog of &#039;example/Atomic Subsystem&#039; is being closed because a mask
parameter has been changed

Any ideas?</description>
		<content:encoded><![CDATA[<p>Is there a way to dynamically change popup menu options of a mask dialog based on parameters of the same mask while it is open and without being forced to close by MATLAB? I have a mask which has 3 parameters:</p>
<p>1) An edit box where I write the name of a MATLAB structure (e.g. MyStruct). This structure has a number of fields which are, in turn, structures with a number of other fields. For example I have a structure named MyStruct with:<br />
MyStruct.Field_A = struct(&#8216;SubField_A1&#8242;,[],&#8217;SubField_A2&#8242;,[])<br />
MyStruct.Field_B = struct(&#8216;SubField_B1&#8242;,[],&#8217;SubField_B2&#8242;,[])</p>
<p>2) A popup menu which I want to include as options the names of the fields of the structure in the first parameter (i.e., fieldnames(MyStruct) in this example);</p>
<p>3) A popup menu which I want to include as options the names of the sub-fields of the structure MyStruct.(FieldName), where FieldName is the field name selected in the previous popup menu (i.e. fieldnames(MyStruct.(FieldName))</p>
<p>I have code to do this (using the parameter callback functions of parameters 1) and 2)) but each time I maque a selection of parameter 2) that changes the contents of the options of parameter 3) MATLAB closes the mask dialog and issues the following warning:</p>
<p>Warning: The dialog of &#8216;example/Atomic Subsystem&#8217; is being closed because a mask<br />
parameter has been changed</p>
<p>Any ideas?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Japhet</title>
		<link>http://blogs.mathworks.com/seth/2008/08/13/dynamic-mask-dialogs/#comment-1244</link>
		<dc:creator>Japhet</dc:creator>
		<pubDate>Wed, 06 Oct 2010 21:02:29 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.mathworks.com/seth/2008/08/13/dynamic-mask-dialogs/#comment-1244</guid>
		<description>Hi Seth,
I mask a C S-function and I use a mask parameter (check) to update the number of input ports in the S-function. I want to update the port labels also. When I place in the mask callbacks, I got the following warning:
Warning: Port number 2 specified in &#039;port_label&#039; exceeds the number of input ports of &#039;...&#039;
Is there a better way to that without this warning ?
Thanks.</description>
		<content:encoded><![CDATA[<p>Hi Seth,<br />
I mask a C S-function and I use a mask parameter (check) to update the number of input ports in the S-function. I want to update the port labels also. When I place in the mask callbacks, I got the following warning:<br />
Warning: Port number 2 specified in &#8216;port_label&#8217; exceeds the number of input ports of &#8216;&#8230;&#8217;<br />
Is there a better way to that without this warning ?<br />
Thanks.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jack</title>
		<link>http://blogs.mathworks.com/seth/2008/08/13/dynamic-mask-dialogs/#comment-1095</link>
		<dc:creator>Jack</dc:creator>
		<pubDate>Mon, 31 May 2010 13:34:44 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.mathworks.com/seth/2008/08/13/dynamic-mask-dialogs/#comment-1095</guid>
		<description>Thanks for your answer,
I&#039;m using 2006b and I do not have R2010a</description>
		<content:encoded><![CDATA[<p>Thanks for your answer,<br />
I&#8217;m using 2006b and I do not have R2010a</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Guy</title>
		<link>http://blogs.mathworks.com/seth/2008/08/13/dynamic-mask-dialogs/#comment-1093</link>
		<dc:creator>Guy</dc:creator>
		<pubDate>Wed, 26 May 2010 15:00:57 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.mathworks.com/seth/2008/08/13/dynamic-mask-dialogs/#comment-1093</guid>
		<description>@Jack, Which release of MATLAB are you using? 

I think this behavior has been modified in MATLAB R2010a and now the dialog callback is triggered also when you comeback to the original value.

If this does not behave as you expect in the latest release, I recommend contacting technical support.</description>
		<content:encoded><![CDATA[<p>@Jack, Which release of MATLAB are you using? </p>
<p>I think this behavior has been modified in MATLAB R2010a and now the dialog callback is triggered also when you comeback to the original value.</p>
<p>If this does not behave as you expect in the latest release, I recommend contacting technical support.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jack</title>
		<link>http://blogs.mathworks.com/seth/2008/08/13/dynamic-mask-dialogs/#comment-1092</link>
		<dc:creator>Jack</dc:creator>
		<pubDate>Tue, 25 May 2010 21:12:31 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.mathworks.com/seth/2008/08/13/dynamic-mask-dialogs/#comment-1092</guid>
		<description>How can I avoid the fact that mask parameters of type &#039;edit&#039; don&#039;t trigger the dialog callback when I return to the previous value ?
For example, I have a mask with 2 parameters &#039;a&#039; and &#039;b&#039; of type &#039;edit&#039;. I set a dialog callback of &#039;a&#039; to copy the value of &#039;a&#039; in &#039;b&#039;. First time, it works when I change &#039;a&#039; from 0 to 1. When I come back to 0, my callback is never triggered. How can we deal with this ?

Thanks you very much</description>
		<content:encoded><![CDATA[<p>How can I avoid the fact that mask parameters of type &#8216;edit&#8217; don&#8217;t trigger the dialog callback when I return to the previous value ?<br />
For example, I have a mask with 2 parameters &#8216;a&#8217; and &#8216;b&#8217; of type &#8216;edit&#8217;. I set a dialog callback of &#8216;a&#8217; to copy the value of &#8216;a&#8217; in &#8216;b&#8217;. First time, it works when I change &#8216;a&#8217; from 0 to 1. When I come back to 0, my callback is never triggered. How can we deal with this ?</p>
<p>Thanks you very much</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Seth</title>
		<link>http://blogs.mathworks.com/seth/2008/08/13/dynamic-mask-dialogs/#comment-700</link>
		<dc:creator>Seth</dc:creator>
		<pubDate>Tue, 03 Mar 2009 02:13:10 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.mathworks.com/seth/2008/08/13/dynamic-mask-dialogs/#comment-700</guid>
		<description>@Tom - Buttons can not be added to user written masks using the Mask Editor.  If the mask editor doesn&#039;t provide the flexibility you need, make a GUI using M-code or GUIDE and set the OpenFcn for the block to launch your GUI.</description>
		<content:encoded><![CDATA[<p>@Tom &#8211; Buttons can not be added to user written masks using the Mask Editor.  If the mask editor doesn&#8217;t provide the flexibility you need, make a GUI using M-code or GUIDE and set the OpenFcn for the block to launch your GUI.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Guy Rouleau</title>
		<link>http://blogs.mathworks.com/seth/2008/08/13/dynamic-mask-dialogs/#comment-699</link>
		<dc:creator>Guy Rouleau</dc:creator>
		<pubDate>Tue, 03 Mar 2009 00:31:51 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.mathworks.com/seth/2008/08/13/dynamic-mask-dialogs/#comment-699</guid>
		<description>@Tom,

You should have a look at previous posts from Seth, there is an example that exactly address this question:

http://blogs.mathworks.com/seth/2008/08/13/dynamic-mask-dialogs/</description>
		<content:encoded><![CDATA[<p>@Tom,</p>
<p>You should have a look at previous posts from Seth, there is an example that exactly address this question:</p>
<p><a href="http://blogs.mathworks.com/seth/2008/08/13/dynamic-mask-dialogs/" rel="nofollow">http://blogs.mathworks.com/seth/2008/08/13/dynamic-mask-dialogs/</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tom</title>
		<link>http://blogs.mathworks.com/seth/2008/08/13/dynamic-mask-dialogs/#comment-697</link>
		<dc:creator>Tom</dc:creator>
		<pubDate>Mon, 02 Mar 2009 20:42:28 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.mathworks.com/seth/2008/08/13/dynamic-mask-dialogs/#comment-697</guid>
		<description>In the Simulink &quot;discontinuities&quot; library, the &quot;Saturation Dynamic&quot; block has a button in it&#039;s dialog, and appears to be a masked subsystem.  The mask uses callbacks and initialization code. I&#039;d like to do something similar in my own custom dialogs. Can you explain how this is done?</description>
		<content:encoded><![CDATA[<p>In the Simulink &#8220;discontinuities&#8221; library, the &#8220;Saturation Dynamic&#8221; block has a button in it&#8217;s dialog, and appears to be a masked subsystem.  The mask uses callbacks and initialization code. I&#8217;d like to do something similar in my own custom dialogs. Can you explain how this is done?</p>
]]></content:encoded>
	</item>
</channel>
</rss>

