Symsum every other step

5 ビュー (過去 30 日間)
Christian S.
Christian S. 2020 年 9 月 29 日
編集済み: Alan Stevens 2020 年 9 月 30 日
Hi everybody,
I'm trying to get a symsum runnin' with a count of every other step.
The Formula itself looks like this:
My current code
a=2:2:10
syms p [1 size_x_r_sampling_meter];
f=k^2*p
f1=symsum(f,k,a)
obvjously doesn't work...
Could you please give me a hint, how to solve this problem?
Very best
Christian

採用された回答

Alan Stevens
Alan Stevens 2020 年 9 月 29 日
Does this help:
syms k p
a = [1 5];
f=@(k,p) (2*k)^2*p;
f1=symsum(f,k,a)
f1 =
220*p
  2 件のコメント
Christian S.
Christian S. 2020 年 9 月 29 日
Hi Alan,
thank you for your answer. Sadly not, the function in my script was just a placeholder, the formula I have to go to is more complex.
Thank you anyways and very best
Christian
Alan Stevens
Alan Stevens 2020 年 9 月 29 日
編集済み: Alan Stevens 2020 年 9 月 30 日
The principle of replacing j by, say, j = 2n, and then having n go from 1 to (M-1)/2 still holds.

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeCalculus についてさらに検索

製品


リリース

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by