Hi, i keep getting this error:
Undefined function 'Trapzoid' for input arguments of type 'double'.
below are my codes:
function [output]=Trapzoid(a,b)logN=1:8N=zeros(1,8);A=zeros(1,8);for j=1:8 N(j)=10^(logN(j)); h=1/N(j); x=a:h:b; for i=1:N(j)+1 y(i)=exp(x(i)); end for i=1:N(j) A(j)=A(j)+0.5*h*(y(i)+y(i+1)); endB(j)=log(abs(exp(1)-1-A(j)));end
whenever i call for function Trapzoid(a,b) for eg, trapzoid(1,8) i will get the error: Undefined function 'Trapzoid' for input arguments of type 'double'. can anyone kindly advise on what actually went wrong? Much Thanks in advance!
Best Answer