Path: news.mathworks.com!newsfeed-00.mathworks.com!newsfeed2.dallas1.level3.net!news.level3.com!postnews.google.com!news2.google.com!news.glorb.com!tr22g12.aset.psu.edu!news.mathforum.org!not-for-mail
From: Jumi <plopony@hotmail.com>
Newsgroups: comp.soft-sys.matlab
Subject: error with mpower
Date: Wed, 28 Oct 2009 12:33:22 EDT
Organization: The Math Forum
Lines: 19
Message-ID: <148229629.126692.1256747632594.JavaMail.root@gallium.mathforum.org>
NNTP-Posting-Host: gallium.mathforum.org
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-Trace: support1.mathforum.org 1256747633 10206 144.118.94.39 (28 Oct 2009 16:33:53 GMT)
X-Complaints-To: news@news.mathforum.org
NNTP-Posting-Date: Wed, 28 Oct 2009 16:33:53 +0000 (UTC)
Xref: news.mathworks.com comp.soft-sys.matlab:580674


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... 

note... both Pa and Pe are scalars 

Pa = absorbed/ntrials;    
Pe = emitted/ntrials;

Teff = input('enter effective temperature in K'); 
A = 0.33;                           % albedo of Earth
S = 1367;                           % solar constant 
Tg4 = (1+Pa/Pe)*Teff^4;             
Tg = Tg4^(1/4);                     % ground temp
Ti4 = (Pl/(2*Pe*opl))*Teff^4;       
Ti = Ti4^(1/4);                     % temp of top layer


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?

Thanks =)