<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/264345</link>
    <title>MATLAB Central Newsreader - error with mpower</title>
    <description>Feed for thread: error with mpower</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>Wed, 28 Oct 2009 16:33:22 -0400</pubDate>
      <title>error with mpower</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/264345#690357</link>
      <author>Jumi</author>
      <description>I don't understand why I am getting an error when I run this. It says that there is an error with mpower... that the matrix must be a square. but here... I am just trying to raise a scalar to a scalar power... &lt;br&gt;
&lt;br&gt;
note... both Pa and Pe are scalars &lt;br&gt;
&lt;br&gt;
Pa = absorbed/ntrials;    &lt;br&gt;
Pe = emitted/ntrials;&lt;br&gt;
&lt;br&gt;
Teff = input('enter effective temperature in K'); &lt;br&gt;
A = 0.33;                           % albedo of Earth&lt;br&gt;
S = 1367;                           % solar constant &lt;br&gt;
Tg4 = (1+Pa/Pe)*Teff^4;             &lt;br&gt;
Tg = Tg4^(1/4);                     % ground temp&lt;br&gt;
Ti4 = (Pl/(2*Pe*opl))*Teff^4;       &lt;br&gt;
Ti = Ti4^(1/4);                     % temp of top layer&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
the only way I don't get an error is if I use .^ for Tg and Ti. But I want the output for Ti and Tg to be scalars, not arrays. What am I doing wrong?&lt;br&gt;
&lt;br&gt;
Thanks =)</description>
    </item>
    <item>
      <pubDate>Wed, 28 Oct 2009 17:01:18 -0400</pubDate>
      <title>Re: error with mpower</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/264345#690366</link>
      <author>Peter Brooks</author>
      <description>Jumi &amp;lt;plopony@hotmail.com&amp;gt; wrote in message &amp;lt;148229629.126692.1256747632594.JavaMail.root@gallium.mathforum.org&amp;gt;...&lt;br&gt;
&amp;gt; I don't understand why I am getting an error when I run this. It says that there is an error with mpower... that the matrix must be a square. but here... I am just trying to raise a scalar to a scalar power... &lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; note... both Pa and Pe are scalars &lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Pa = absorbed/ntrials;    &lt;br&gt;
&amp;gt; Pe = emitted/ntrials;&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Teff = input('enter effective temperature in K'); &lt;br&gt;
&amp;gt; A = 0.33;                           % albedo of Earth&lt;br&gt;
&amp;gt; S = 1367;                           % solar constant &lt;br&gt;
&amp;gt; Tg4 = (1+Pa/Pe)*Teff^4;             &lt;br&gt;
&amp;gt; Tg = Tg4^(1/4);                     % ground temp&lt;br&gt;
&amp;gt; Ti4 = (Pl/(2*Pe*opl))*Teff^4;       &lt;br&gt;
&amp;gt; Ti = Ti4^(1/4);                     % temp of top layer&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; the only way I don't get an error is if I use .^ for Tg and Ti. But I want the output for Ti and Tg to be scalars, not arrays. What am I doing wrong?&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Thanks =)&lt;br&gt;
&lt;br&gt;
You're using variables &quot;opl&quot; and &quot;Pl&quot; without having defined them. Assuming that they are both scalars, the code you've posted works fine. Are you positive that Pa and Pe are both scalar quantities?</description>
    </item>
    <item>
      <pubDate>Wed, 28 Oct 2009 17:03:37 -0400</pubDate>
      <title>Re: error with mpower</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/264345#690367</link>
      <author>Steven Lord</author>
      <description>&lt;br&gt;
&quot;Jumi&quot; &amp;lt;plopony@hotmail.com&amp;gt; wrote in message &lt;br&gt;
news:148229629.126692.1256747632594.JavaMail.root@gallium.mathforum.org...&lt;br&gt;
&amp;gt;I don't understand why I am getting an error when I run this. It says that &lt;br&gt;
&amp;gt;there is an error with mpower... that the matrix must be a square. but &lt;br&gt;
&amp;gt;here... I am just trying to raise a scalar to a scalar power...&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; note... both Pa and Pe are scalars&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; Pa = absorbed/ntrials;&lt;br&gt;
&amp;gt; Pe = emitted/ntrials;&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; Teff = input('enter effective temperature in K');&lt;br&gt;
&lt;br&gt;
What do you/the user enter here?  Is Teff a scalar or a nonscalar?  My guess &lt;br&gt;
is that it's nonscalar.  To check this, put a breakpoint on this line in &lt;br&gt;
your code and step through the rest of the execution, making sure on each &lt;br&gt;
line that the variables with which you're working have the sizes you expect.&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>Wed, 28 Oct 2009 19:52:08 -0400</pubDate>
      <title>Re: error with mpower</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/264345#690425</link>
      <author>Bobby Cheng</author>
      <description>Unlike *, ^ does not do scalar expansion.&lt;br&gt;
&lt;br&gt;
So .^ is the way to go for elementwise power.&lt;br&gt;
&lt;br&gt;
---Bob.&lt;br&gt;
&lt;br&gt;
&quot;Steven Lord&quot; &amp;lt;slord@mathworks.com&amp;gt; wrote in message &lt;br&gt;
news:hc9tfo$hpm$1@fred.mathworks.com...&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; &quot;Jumi&quot; &amp;lt;plopony@hotmail.com&amp;gt; wrote in message &lt;br&gt;
&amp;gt; news:148229629.126692.1256747632594.JavaMail.root@gallium.mathforum.org...&lt;br&gt;
&amp;gt;&amp;gt;I don't understand why I am getting an error when I run this. It says that &lt;br&gt;
&amp;gt;&amp;gt;there is an error with mpower... that the matrix must be a square. but &lt;br&gt;
&amp;gt;&amp;gt;here... I am just trying to raise a scalar to a scalar power...&lt;br&gt;
&amp;gt;&amp;gt;&lt;br&gt;
&amp;gt;&amp;gt; note... both Pa and Pe are scalars&lt;br&gt;
&amp;gt;&amp;gt;&lt;br&gt;
&amp;gt;&amp;gt; Pa = absorbed/ntrials;&lt;br&gt;
&amp;gt;&amp;gt; Pe = emitted/ntrials;&lt;br&gt;
&amp;gt;&amp;gt;&lt;br&gt;
&amp;gt;&amp;gt; Teff = input('enter effective temperature in K');&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; What do you/the user enter here?  Is Teff a scalar or a nonscalar?  My &lt;br&gt;
&amp;gt; guess is that it's nonscalar.  To check this, put a breakpoint on this &lt;br&gt;
&amp;gt; line in your code and step through the rest of the execution, making sure &lt;br&gt;
&amp;gt; on each line that the variables with which you're working have the sizes &lt;br&gt;
&amp;gt; you expect.&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;br&gt;
&amp;gt; &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; </description>
    </item>
  </channel>
</rss>

