function ball(p); % BALL ball(p) % draws unit ball of || ||_p for 0 < p < infty plot([0 0],[-1.5 1.5],'k','LineWidth',1.5), hold % y xis plot([-1.5 1.5],[0 0],'k','LineWidth',1.5) % x axis topx=-1:.01:1; topy=(ones(1,201)-abs(topx).^p).^(1/p); botx=.99:-.01:-1; boty=-(ones(1,200)-abs(botx).^p).^(1/p); fill([topx botx],[topy boty],'k','FaceAlpha',0.5,'LineWidth',4) axis equal, axis([-1.5 1.5 -1.5 1.5]) % make x, y equal set(gca,'XTick',[]), set(gca,'YTick',[]), hold off