A simple algorithm
The beauty of core-numbers is that they arey very intuitive to compute and understand.
Let's load some data. This graph comes from the paper with the O(m) algorithm to compute the core numbers of an undirected graph by Batagelj and Zaversnik, "An O(m) algorithm for the cores decomposition of a network."
load '../graphs/cores_example.mat';
Plot the data.
gplot(A,xy); hold on; plot(xy(:,1), xy(:,2),'r.','MarkerSize',24); hold off; text(xy(:,1)+0.1, xy(:,2)+0.1, num2str((1:21)'));set(gcf,'Color',[1,1,1]); set(gca,'XTick',[]);set(gca,'YTick',[]);xlim([-1,10]);ylim([-2,7]);axis off;

By inspection, vertex 16 is in a 0 core because it has no edges in the graph.
From the statement of the property, let's figure out the core numbers for this graph. For each possible degree d, let's remove all vertices with degree <= d and degree>0 and repeat this until there are no vertices with degree (0,d]. Then, any vertex that is left, must have core number at least d+1.
The following code implements that algorithm where the graph Ad is the current working version of the graph. At the end of the for loop, the graph Ad is the graph A where all vertices of degree <= d have been removed.
max_deg = full(max(sum(A))); cn = zeros(num_vertices(A),1); Ad = A; dvec=sum(Ad); for d=0:max_deg % while they are vertices with degree in (0,d], remove them while any(dvec<=d&dvec>0), Ad(dvec<=d,:)=0;Ad(:,dvec<=d)=0;dvec=sum(Ad);end % any vertex that is left must core number at least d+1; cn(dvec>d) = d+1; end arrayfun(@(v,c) fprintf('core_number(%2i) = %i\n',v,c),1:num_vertices(A),cn');
core_number( 1) = 1 core_number( 2) = 2 core_number( 3) = 2 core_number( 4) = 3 core_number( 5) = 3 core_number( 6) = 3 core_number( 7) = 3 core_number( 8) = 3 core_number( 9) = 2 core_number(10) = 3 core_number(11) = 2 core_number(12) = 1 core_number(13) = 1 core_number(14) = 3 core_number(15) = 3 core_number(16) = 0 core_number(17) = 2 core_number(18) = 2 core_number(19) = 2 core_number(20) = 2 core_number(21) = 1
The output shows us that vertex 16 is the only vertex with a core number of 0. Because this graph is an example, "it just so happens" that the cores make a nice picture. The following code plots the convex hull around the points inside of a k-core. The darker the color, the higher the core.
clf; hold on; wh=ones(1,3); colors={0.85*wh,0.7*wh,0.55*wh,0.4*wh}; for c=0:max(cn) m = cn >= c; xym = xy(m,:); cl=colors{c+1}; lw=16*1.5^(max(cn)-c); ids=convhull(xym(:,1),xym(:,2)); h=fill(xym(ids,1),xym(ids,2),cl);set(h,'LineWidth',lw,'EdgeColor',cl); end gplot(A,xy,'k-'); plot(xy(:,1), xy(:,2),'r.','MarkerSize',24); hold off; text(xy(:,1)+0.1, xy(:,2)+0.1, num2str((1:21)'));set(gcf,'Color',[1,1,1]); xlim([-1,10]);ylim([-2,7]);axis off; hold off; % this figure must be printed with getframe and not print.

The cores are nested, so vertex 10 is in the 0-core, 1-core, 2-core and 3-core.
With MatlabBGL
The MatlabBGL function core_numbers implements efficient algorithms to compute the cores of a graph. These algorithms are significantly more efficient than the previous code and produce identical output.
Let's check that they produce the same output.
cn_bgl = core_numbers(A); any(cn_bgl-cn)
ans = 0