Summation of an array

1 回表示 (過去 30 日間)
Barry Allen
Barry Allen 2020 年 2 月 5 日
コメント済み: Barry Allen 2020 年 2 月 6 日
How can i code this in matlab?

採用された回答

JESUS DAVID ARIZA ROYETH
JESUS DAVID ARIZA ROYETH 2020 年 2 月 5 日
if length(P) and length(Y) is N:
x=sum(P.*Y)
in another case:
N=5; %set any value for N
x=sum(P(1:N).*Y(1:N))
  1 件のコメント
Barry Allen
Barry Allen 2020 年 2 月 6 日
What if N is different?

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeSymbolic Math Toolbox についてさらに検索

製品


リリース

R2017b

Community Treasure Hunt

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

Start Hunting!

Translated by