y = @(x) x^2

xv = [-32:31]
yv = arrayfun(y,xv)

H3= [(-8:-1);(24:31)]
H3y= arrayfun(y,H3)

H4=[-32,-31,-26,-25,-16,-15,-8,-7,0,1,8,9,16,17,24,25]
H4y= arrayfun(y,H4)
hold all

stem(H3,H3y,'-.g*');
stem(H4,H4y,':r*');
plot(xv,yv,'b*');

xlabel('x');
ylabel('y');

hold off
legend('Loesungsraum H3','Loesungsraum H4','f(x)=x^2') %bug in legend function
