Please Help! How to fix this error "Not enough input arguments." I have marked the error line in BOLD.

function pr=prnab(Ex,Dx,xa,xb)
% Prawdopodbienstwo zmiennej losowej normalnej w przedziale: xa <= X < xb
% wart. oczek. - Ex
% odchyl. standardowe - Dx
% dolna wartosc - xa
% gorna wartosc - xb
% Standaryzacja zmiennej losowej: t=(x-Ex)/Dx
% Wywolanie funkcji erf(t)
% erf(t)=2/sqrt(pi)*calka(od 0 do t)[exp(-t^2]dt
% F(t)=0.5+0.5*erf(t/sqrt(2)) dla t >= 0
% F(t)=0.5-0.5*erf(t/sqrt(2)) dla t < 0
% Obliczenie wartosci dystrybuanty dla gornej wartosci xb
tb=(xb-Ex)/Dx;
Fb=0.5*(1+sign(tb)*erf( abs(tb)/sqrt(2) ));
% Obliczenie wartosci dystrybuanty dla dolnej wartosci xa
ta=(xa-Ex)/Dx;
Fa=0.5*(1+sign(ta)*erf( abs(ta)/sqrt(2) ));
% Prawdopodobienstwo pr=P{xa <= X < xb }
pr=(Fb-Fa);
end %koniec prnab()

3 Comments

Sorry the language is polish but i hope it dosen't bother.
How did you call the function? What are the input values?
% Assign input values:
Ex = ?????
Dx = ??????
xa = ?????
xb = ?????
% Now, call the function here.
pr = prnab(Ex, Dx, xa, xb)
You didn't just click the green run triangle without assigning any values did you?
Thanks mate, I am not so good in matlab.
I appreciate your help :)

Sign in to comment.

Answers (0)

Products

Release

R2018b

Asked:

on 20 Jun 2021

Commented:

on 21 Jun 2021

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!