This is the code:
r = 2p = sym('p', [1 r])syms ka =symprod(p(k),k,1,r)
And this is the result:
>> Untitledr = 2p =[ p1, p2]Error using sym/subsindex (line 737)Invalid indexing or function definition. When defining a function, ensure that the arguments are symbolic variables and thebody of the function is a SYM expression. When indexing, the input must be numeric, logical, or ':'.Error in sym/subsref (line 776) R_tilde = builtin('subsref',L_tilde,Idx);Error in Untitled (line 4)a =symprod(p(k),k,1,r)
So i obtained that error which I cannot solve. The answer that im looking for is a = p1*p2*….*pr
Im using MATLAB 2015B.
Thank you for your help.
Best Answer