Akzeptierte Antwort

KSSV
KSSV am 7 Jun. 2021
Bearbeitet: KSSV am 7 Jun. 2021

1 Stimme

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))

Weitere Antworten (1)

kamal bouha
kamal bouha am 7 Jun. 2021

0 Stimmen

1 Kommentar

kamal bouha
kamal bouha am 7 Jun. 2021
I need a help for term in the right hand side, please

Melden Sie sich an, um zu kommentieren.

Kategorien

Mehr zu MATLAB finden Sie in Hilfe-Center und File Exchange

Produkte

Version

R2016a

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by