Array indices must be positive integers or logical values.

조회 수: 1 (최근 30일)
dylan stephens
dylan stephens 2021년 2월 26일
댓글: KSSV 2021년 2월 26일
function [z]=phi(x)
%Determine phi(x) using the formulas provided
%2/25/21
%AE 227
a=0.4361836;
b=0.1201676;
c=0.937298;
r=exp(-.5*(x^2))/sqrt(2*pi);
t=1/(1+(0.3326*x));
z=0.5-r(a*t-b(t^2)+c(t^3));
end

채택된 답변

KSSV
KSSV 2021년 2월 26일
편집: KSSV 2021년 2월 26일
function [z]=phi(x)
%Determine phi(x) using the formulas provided
%2/25/21
%AE 227
a=0.4361836;
b=0.1201676;
c=0.937298;
r=exp(-.5*(x.^2))/sqrt(2*pi);
t=1./(1+(0.3326*x));
z=0.5-r.*(a*t-b*(t.^2)+c*(t.^3)); % <--- change in this line
end
  댓글 수: 5
dylan stephens
dylan stephens 2021년 2월 26일
Would you be able to provide a link to element by element operations unable to find it in my book.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Logical에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by