%Intervallschachtellung
function [Mm K_M0]=Intervallschachtellung(Mm)
  global M R Km K_M0 Mm
  k=0
  j=1
  l=2
  MR=round(max(Km)*0.04/12);                                 %monatliche Rendite
  abs(round(MR)-Mm)
  if (round(MR)-round(Mm))<0
    Mm=Mm-(Mm-MR)/2
  endif
  if (round(MR)-Mm)>0
    Mm=Mm+(Mm-max(Km))/2
  endif
  K_M0=R-Mm;
endfunction