How can I create an array of 100 elements

18 vues (au cours des 30 derniers jours)
SP
SP le 15 Oct 2018
Modifié(e) : madhan ravi le 15 Oct 2018
How can I create an array of 100 elements with n-th element valued as 1 / √(2n^2)

Réponse acceptée

madhan ravi
madhan ravi le 15 Oct 2018
Modifié(e) : madhan ravi le 15 Oct 2018
n=1:100
sequence = 1 ./ sqrt(2*n.^2)
Or
syms n
s=1:99
sequence = 1 ./ sqrt(2*n.^2)
array =[ s sequence ]
array = subs(array,n,3)

Plus de réponses (0)

Catégories

En savoir plus sur Logical 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