How do i resolve the error in this code:
Afficher commentaires plus anciens
% Programme for estimating k in DE
prompt= 'input a value for k : ' ;
k = input(prompt);
w =(pi/12);
n=1:100;
k(n+1)=-1*(log(((12*(((k(n))^2)+(w^2))-(5*k(n))*(k(n)*cos(6*w))+(wsin(6*w)))/(17*((k(n)^2)+(w^2))-5*k(n)*(k(n)*cos(5*w))+(w*sin5w)));
disp (k)
the problem seems to be with the semicolon after the log funtion
2 commentaires
Walter Roberson
le 10 Fév 2016
You have not indicated what the error is.
Is the user entering a vector or a scalar?
Is k(n) intended to indicate k indexed at n, or k multiplied by n?
Hint: .^ .* ./
reuben crockett
le 10 Fév 2016
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Entering Commands 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!