Create a symbolic function with varying number of elements

1 回表示 (過去 30 日間)
Luka Lorbek
Luka Lorbek 2019 年 3 月 19 日
コメント済み: Luka Lorbek 2019 年 3 月 19 日
I wish to create a symbolic function where N is an arbitrary integer. For a specific case N is known and the number of elements in the function is thus defined, but N will vary across different cases and I need to automate the creation of .
Any help would be appreciated.

採用された回答

madhan ravi
madhan ravi 2019 年 3 月 19 日
syms x
N=4;
f(x)=sum(x.^(0:N))

その他の回答 (0 件)

Community Treasure Hunt

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

Start Hunting!

Translated by