What is the error here?
古いコメントを表示
clear all clc; alfa=0.5; bet=2; lan=1; teta=2; mu=0.5; n=4; k=2; s=0; syms u for j=k:n s=s+(factorial(j-1)/(factorial(k-1)*factorial(j-k)))*((-1)^(j-k))... (factorial(n)/(factorial(j)*factorial(n-j)))(exp(-alfa*j*((u/(1-u))^bet))); end;
integral(s, 0, 1,'ArrayValued',true )
1 件のコメント
Torsten
2022 年 3 月 25 日
Please format your code.
回答 (1 件)
There are some syntax errors.
clear all
clc;
alfa=0.5;
bet=2;
lan=1;
teta=2;
mu=0.5;
n=4;
k=2;
s=0;
syms u
for j=k:n
s=s+(factorial(j-1)/(factorial(k-1)*factorial(j-k)))*((-1)^(j-k))... % missing operator (+ or * maybe?) here, between ")" on this line and "(" on the next line
(factorial(n)/(factorial(j)*factorial(n-j)))(exp(-alfa*j*((u/(1-u))^bet)));
% ^^ missing operator (* maybe?) here
end; % extra 'end'
end
integral(s, 0, 1,'ArrayValued',true )
Making a guess at putting in those 2 missing operators, there is still an error in the usage of integral():
clear all
clc;
alfa=0.5;
bet=2;
lan=1;
teta=2;
mu=0.5;
n=4;
k=2;
s=0;
syms u
for j=k:n
s=s+(factorial(j-1)/(factorial(k-1)*factorial(j-k)))*((-1)^(j-k))*...
(factorial(n)/(factorial(j)*factorial(n-j)))*(exp(-alfa*j*((u/(1-u))^bet)));
% end;
end
integral(s, 0, 1,'ArrayValued',true )
カテゴリ
ヘルプ センター および File Exchange で Calculus についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!