MATLAB: Getting an empty figure for line plot of sine function

empty figureline plotsine function

I'm trying to plot a sine function but I'm getting an empty figure
x=-10:10;
y = (sin(sin(pi*x))) / (pi*x);
zf(1) = figure(1);
za = axes;
zp = plot(x,y);
set(zp(1),'color','m','linewidth',3,'linestyle','-');

Best Answer

Use element-wise division operator
y = (sin(sin(pi*x))) ./ (pi*x);
%^ use ./ instead of /