Path: news.mathworks.com!newsfeed-00.mathworks.com!newsfeed2.dallas1.level3.net!news.level3.com!postnews.google.com!t19g2000prd.googlegroups.com!not-for-mail
From: tzygmund <tzygmund@googlemail.com>
Newsgroups: comp.soft-sys.matlab
Subject: quad error
Date: Tue, 19 Apr 2011 13:27:59 -0700 (PDT)
Organization: http://groups.google.com
Lines: 33
Message-ID: <2d350472-226f-4122-8c33-4ed7b7ee5ddc@t19g2000prd.googlegroups.com>
NNTP-Posting-Host: 128.54.250.224
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
X-Trace: posting.google.com 1303244880 10592 127.0.0.1 (19 Apr 2011 20:28:00 GMT)
X-Complaints-To: groups-abuse@google.com
NNTP-Posting-Date: Tue, 19 Apr 2011 20:28:00 +0000 (UTC)
Complaints-To: groups-abuse@google.com
Injection-Info: t19g2000prd.googlegroups.com; posting-host=128.54.250.224; posting-account=d0ZnjAoAAACoBOGGXQZyBG9_Cp9X6UEf
User-Agent: G2/1.0
X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.16)
 Gecko/20110319 Firefox/3.6.16,gzip(gfe)
Xref: news.mathworks.com comp.soft-sys.matlab:722804


Hello,

I have a simple function to numerically integrate and it depends on
the scalar 't':

%%%%%%%%%%%%%%%%%
function omegafun = omegafun(mM1, t)
 omegafun =  sqrt(det(eye(size(mM1, 1)) -2*t.*mM1))
end
%%%%%%%%%%%%%%%%%

Here mM1 is a parameter matrix. I am able to compute this function and
plot it, but when I try quad,

quad(@(t) omegafun(mM1, t), 0, 10);

I get the error:

??? Error using ==> times
Matrix dimensions must agree.

Error in ==> omegafun at 2
 omegafun =  sqrt(det(eye(size(mM1, 1)) -2*t.*mM1))

Error in ==> @(t)omegafun(t,mM1)


Error in ==> quad at 77
y = f(x, varargin{:});


Something obvious that I am missing?