Réponse acceptée

KSSV
KSSV le 7 Juin 2021
Modifié(e) : KSSV le 7 Juin 2021

1 vote

u = rand(1,100) ; % data for demo
k = 20 ;
thesum = 0 ;
for j = 1:k-1
thesum = thesum+sqrt(k-j)*u(j) ;
end
You can achieve the same without loop using:
j = 1:k-1 ;
iwant = sum(sqrt(k-j).*u(j))

Plus de réponses (1)

kamal bouha
kamal bouha le 7 Juin 2021

0 votes

1 commentaire

kamal bouha
kamal bouha le 7 Juin 2021
I need a help for term in the right hand side, please

Connectez-vous pour commenter.

Catégories

En savoir plus sur Get Started with MATLAB dans Centre d'aide et File Exchange

Produits

Version

R2016a

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by