<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
 <channel>
  <atom:link href="http://www.comsol.com/community/forums/general/rss/thread/24345.rss" rel="self" type="application/rss+xml"/>
  <title>COMSOL Forums: model.param.get does not return complex values</title>
  <link>http://www.comsol.com/community/forums/general/thread/24345/</link>
  <description>Most recent forum messages</description>
  <pubDate>Mon, 28 Nov 2011 05:15:32 +0000</pubDate>
  <image>
   <title>COMSOL Forums: model.param.get does not return complex values</title>
   <url>http://www.comsol.com/shared/images/logos/comsol_logo.gif</url>
   <link>http://www.comsol.com/community/forums/general/thread/24345/</link>
  </image>
  <item>
   <title>Re: model.param.get does not return complex values</title>
   <link>http://www.comsol.com/community/forums/general/thread/24345/#p65325</link>
   <description>Hi&lt;br /&gt;&#13;
&lt;br /&gt;&#13;
Then I think it's worth to get that confirmed by &amp;quot;support&amp;quot;. I find it somewhat astonishing, but OK, I hardly use matlab now with V4&lt;br /&gt;&#13;
&lt;br /&gt;&#13;
--&lt;br /&gt;&#13;
Good luck&lt;br /&gt;&#13;
Ivar</description>
   <pubDate>Mon, 28 Nov 2011 05:15:32 +0000</pubDate>
   <guid isPermaLink="false">24345.1322457332.65325</guid>
  </item>
  <item>
   <title>Re: model.param.get does not return complex values</title>
   <link>http://www.comsol.com/community/forums/general/thread/24345/#p65315</link>
   <description>&lt;br /&gt;&#13;
No, the model.param.set does not work if you set a parameter to a complex number.&lt;br /&gt;&#13;
&lt;br /&gt;&#13;
Currently, I am getting around this by turning the complex value into a string and&lt;br /&gt;&#13;
setting the parameter to that string.&lt;br /&gt;&#13;
&lt;br /&gt;&#13;
Example:&lt;br /&gt;&#13;
v1 = 4.5+j*2.5&lt;br /&gt;&#13;
v1String = num2str(v1);&lt;br /&gt;&#13;
model.param.set('v1', v1String);&lt;br /&gt;&#13;
&lt;br /&gt;&#13;
Then when I call&lt;br /&gt;&#13;
model.param.get('v1') &lt;br /&gt;&#13;
&lt;br /&gt;&#13;
I get the correct value:&lt;br /&gt;&#13;
4.5+j*2.5&lt;br /&gt;&#13;
&lt;br /&gt;&#13;
So, I guess to pass complex values to model.param.set, you need to convert it to a string first.&lt;br /&gt;&#13;
&lt;br /&gt;&#13;
Regards,&lt;br /&gt;&#13;
Emi </description>
   <pubDate>Sun, 27 Nov 2011 20:20:38 +0000</pubDate>
   <guid isPermaLink="false">24345.1322425238.65315</guid>
  </item>
  <item>
   <title>Re: model.param.get does not return complex values</title>
   <link>http://www.comsol.com/community/forums/general/thread/24345/#p65311</link>
   <description>Hi&lt;br /&gt;&#13;
&lt;br /&gt;&#13;
I'm not sure you can retrieve the comlex value in one call, have you tried to recall twice with a real() and imag()&lt;br /&gt;&#13;
&lt;br /&gt;&#13;
--&lt;br /&gt;&#13;
Good luck&lt;br /&gt;&#13;
Ivar</description>
   <pubDate>Sun, 27 Nov 2011 18:55:43 +0000</pubDate>
   <guid isPermaLink="false">24345.1322420143.65311</guid>
  </item>
  <item>
   <title>model.param.get does not return complex values</title>
   <link>http://www.comsol.com/community/forums/general/thread/24345/#p65289</link>
   <description>I set a parameter to a complex value by:&lt;br /&gt;&#13;
&lt;br /&gt;&#13;
model.param.set('v1', 4.5+j*2)&lt;br /&gt;&#13;
&lt;br /&gt;&#13;
However, when I try to access the parameter later by&lt;br /&gt;&#13;
&lt;br /&gt;&#13;
 model.param.get('v1')&lt;br /&gt;&#13;
&lt;br /&gt;&#13;
All I get is&lt;br /&gt;&#13;
&lt;br /&gt;&#13;
4.5&lt;br /&gt;&#13;
&lt;br /&gt;&#13;
I am using comsol4.2a and matlab 2011a on a 64 bit linux machine.&lt;br /&gt;&#13;
&lt;br /&gt;&#13;
Does the error occur when I am setting the parameter value or when I am accessing it.&lt;br /&gt;&#13;
&lt;br /&gt;&#13;
In other words, is 'v1' correctly set to the complex value, and it is just the model.param.get that is not&lt;br /&gt;&#13;
working properly?&lt;br /&gt;&#13;
&lt;br /&gt;&#13;
Or, is it model.param.set which is not setting 'v1' correctly?&lt;br /&gt;&#13;
&lt;br /&gt;&#13;
I would appreciate any help.&lt;br /&gt;&#13;
&lt;br /&gt;&#13;
Thank you,&lt;br /&gt;&#13;
Emi</description>
   <pubDate>Sun, 27 Nov 2011 09:43:57 +0000</pubDate>
   <guid isPermaLink="false">24345.1322387037.65289</guid>
  </item>
 </channel>
</rss>
