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 Center および File ExchangeLogical についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by