function PlotResults(t,y,name)
    figure;
    
    %fit of t and y
    subplot(2,2,1);
    plot(y,'k');
    hold on;
    plot(t,'r:');
    legend('Outputs','Targets');
    title(name);
    
    %correlation
    subplot(2,2,2);
    plot(t,y,'ko');
    hold on;
    xmin=min(min(t),min(y));
    xmax=max(max(t),max(y));
    plot([xmin xmax],[xmin xmax], 'b', 'LineWidth', 2);
    R=corr(t',y');
    title(['Correlation R=' num2str(R)]);
    
    %Errors
    subplot(2,2,3);
    e=t-y;
    plot(e,'b');
    legend('Error');
    MSE=mean(e.^2);
    RMSE=sqrt(MSE);
    title(['MSE=' num2str(MSE) ' ,RMSE=' num2str(RMSE)]);
    
    %Histogram
    subplot(2,2,4);
    histfit(e,50);
    eMean=mean(e);
    eStd=std(e);
    title(['\mu=' num2str(eMean) ',\sigma' num2str(eStd)]);

end