Effacer les filtres
Effacer les filtres

M.file implementing the formula below using either Mat-lab or octave

2 vues (au cours des 30 derniers jours)
In the following, R can take any value between 5 and 6. Work out the value of I for R = 5.00, 5.01, 5.02, ..., and 6. Then find the average value of I. I= 30/(R*(sqrt(R^2+15*pi^2))

Réponse acceptée

Stalin Samuel
Stalin Samuel le 20 Fév 2015
r = 5.00:0.01:6.00
for i=1:numel(r)
R=r(i)
I(i)= 30/(R*(sqrt(R^2+15*pi^2)))
end
avg =mean(I)
  2 commentaires
Titus Edelhofer
Titus Edelhofer le 20 Fév 2015
Hi Samuel,
there is no need to use a loop, if you replace "30/" by "30./" and the "*" and "^2" by ".*" and ".^2" ...
Titus
Stalin Samuel
Stalin Samuel le 21 Fév 2015
Thank you

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Octave dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by