Plot an equation (sigma operator)
2 views (last 30 days)
Show older comments
Commented: Star Strider on 2 Jul 2022
I would like to plot this equation for x=[-2,2] and x=3, I wrote this code but it ain't working. Could you please tell me how can I make it work ? Thanks in advance.
Try soemthing like this —
H = zeros(size(xv));
Hv = zeros(size(xv));
for k2 = 1:numel(xv)
x = xv(k2);
for k1 = 1:numel(kv)
Hv(k1) = ((-1)^kv(k1))*factorial(n)*(x^(n-2*kv(k1)))/(2^kv(k1)*factorial(kv(k1))*factorial(n-2*kv(k1)));
H(k2) = sum(Hv);
The ‘H’ variable was being saved as a scalar, not a vector.
More Answers (1)
Find more on Mathematics in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!Start Hunting!