Thanks yes that does fix it. Also the NAN answers are only returned when delta is set to zero since the computer then thinks that when E is zero too it is dividing by zero. If i put an extra thing into avoid that it should work fine. Thanks a lot for your help.
Thankyou. I have actually changed that now but I am getting a new error:
? Index exceeds matrix dimensions.
Error in ==> quad at 85
if ~isfinite(y(7))
new function code:
function [ f1 ] = func1( E, Delta, kB, Temp )
%func1: calculates integrand for eqn 1
% Detailed...
Hey I'm having problems trying to integrate my function func1 in MATLAB. Really don't know where I am going wrong so would really appreciate if anyone could help. The code I'm using is below, thanks:
Function Mfile:
function [ f1 ] = func1( E, Delta, kB, Temp )
%func1: calculates...
Help with integrating function in Matlab
Hi I'm trying to integrate a function func1 in Matlab but I keep getting errors I really don't know what I'm doing wrong. Can anyone tell me?
Here is the code I am using:
function [ f1 ] = func1( E, Delta, kB, Temp )
%func1: calculates integrand...