My code is
x =0:1:1000; y=-((1/2).^x).*log2((1/2).^x); H=sum(y);
And i want to plot (x,H),however,there is no curve in the figure when using plot(x,H),So i want to ask which command should i use?or if i can use the plot,where is my mistake?
plot
x =0:1:1000; y=-((1/2).^x).*log2((1/2).^x); H=sum(y);
Best Answer