#### Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

#### Categories

Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

# Quad Function Error Messages

Posts: 3Member
Hi,

I have been trying to find the area under a standard distribution curve, but am getting the following errors when run my .m file.

??? Error using ==> inline.subsref at 14
Not enough inputs to inline function.

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

Error in ==> CannonBP4 at 7
quad('(e.^(-.5*((x-m)/sd).^2)/(sd.*(2*pi)^.5))','x',173.8-34.8,173.8+34.8)

Here is my code:
x=0:.1:350;
sd=34.80;
m=173.80;
e=2.718283;
y=(e.^(-.5*((x-m)/sd).^2)/(sd.*(2*pi)^.5));
plot(x,y)
quad('(e.^(-.5*((x-m)/sd).^2)/(sd.*(2*pi)^.5))','x',173.8-34.8,173.8+34.8)

## Comments

• Posts: 217Member
Try:
[code]
y=@(x)(e.^(-.5*((x-m)/sd).^2)/(sd.*(2*pi)^.5));
quad(y,173.8-34.8,173.8+34.8)[/code]

• Posts: 217Member
Try:
[code]
y=@(x)(e.^(-.5*((x-m)/sd).^2)/(sd.*(2*pi)^.5));
quad(y,173.8-34.8,173.8+34.8)[/code]

• Posts: 3Member
Thanks,

That works
Sign In or Register to comment.