symsum and subscript. confirmation regarding limit for sum

Hi Folks,
I check the forum, and I see in the answers that subscript for variable that inside a sum term can not be a symbolic. But I just want confirm the code below.
I can't use n as symbolic variable simularly in example below.
Note i just it just index.
syms h(x)
n = 3;
syms k real positive
x = [sym('x_0'), sym('y_%d', [1, n])];
y = [sym('x_0'), sym('y_%d', [1, n])];
1-k/2 * n * symsum(1/k * (y(n).*log(h(x(n))) + (1-y(n)).*log(h(x(n)))), 1, n)
Thank you

Answers (0)

Categories

Find more on Mathematics in Help Center and File Exchange

Products

Release

R2022a

Tags

Asked:

on 21 Apr 2022

Community Treasure Hunt

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

Start Hunting!