You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: roc50.m
    path of file: ./repos/CanlabCore/CanlabCore/External/spider/basic/@loss
    
    the code of the file until where you have to start completion: function dat = roc50(algo,dat)
  
  
%
%           dat = roc50(algo,dat)
%
% calculates roc 50 curves. If param is not empty, a curve is also be

    
function dat = roc50(algo,dat)
  
  
%
%           dat = roc50(algo,dat)
%
% calculates roc 50 curves. If param is not empty, a curve is also be
% plotted, where param determines the linestyle (e.g. param='--*')
%


  cutoff=50;

  [x y]=get_xy(dat);
    
  if sum(y==-1)==0  %% <-- not possible to produce a roc curve
    lss=0;
    r=data([get_name(dat) ' -> roc50 = ' num2str(lss,4) ],[],1);
    return;
  end