Path: news.mathworks.com!not-for-mail
From: "Grant Ericson" <gericson@uncc.edu>
Newsgroups: comp.soft-sys.matlab
Subject: erf(x) troubles
Date: Tue, 3 Nov 2009 18:30:24 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 34
Message-ID: <hcpss0$58s$1@fred.mathworks.com>
Reply-To: "Grant Ericson" <gericson@uncc.edu>
NNTP-Posting-Host: webapp-05-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1257273024 5404 172.30.248.35 (3 Nov 2009 18:30:24 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Tue, 3 Nov 2009 18:30:24 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 2075133
Xref: news.mathworks.com comp.soft-sys.matlab:582123


Trying to plot a this function so I can thermal conductivity 'k':

close all
clear

k = -1:.05:1;

for j=1:length(k)

A(j) = erf(.295099*k(j)^-.5);
B(j) = exp(13.48325*k(j)^-1);
C(j) = erf(3.68379*k(j)^-.5);

D(j) = A(j)+B(j)-(B(j)*C(j))-(7/15);

end

plot(k,D)


However, MATLAB keeps giving me this error message:

??? Error using ==> erfcore
Input must be real.

Error in ==> erf at 21
y = erfcore(x,0);

Error in ==> ht5_76 at 11
y = erf(.295099*k(j)^-.5);

Can someone help me out?  Apparently, I am not MATLAB-literate.

Thanks.