What is the error here?
Afficher commentaires plus anciens
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 commentaire
Torsten
le 25 Mar 2022
Please format your code.
Réponses (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 )
Catégories
En savoir plus sur Calculus dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!