From a8a5a3e8683b7e6364656b9f92eaa53c7a1acb9c Mon Sep 17 00:00:00 2001
From: marwan <>
Date: Thu, 14 Apr 2016 15:26:53 +0000
Subject: [PATCH] in recons.m: add test for empty results vector

---
 recons.m | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/recons.m b/recons.m
index bb9f367..19012f7 100644
--- a/recons.m
+++ b/recons.m
@@ -41,6 +41,9 @@ function varargout=recons(varargin)
 % $Revision$
 %
 % $Log$
+% Revision 5.5  2016/04/14 15:15:20  marwan
+% adding Hirata's reconstruction method to recons.m
+%
 % Revision 5.4  2016/03/03 14:57:40  marwan
 % updated input/output check (because Mathworks is removing downwards compatibility)
 % bug in crqad_big fixed (calculation of xcf).
@@ -195,6 +198,14 @@ else
     n = sum(NN2,1);
     borderI=find(n==0);
     borderI(ismember(borderI,rem)) = [];
+    
+    if isempty(borderI)
+       warning('Reconstruction method failed. Try with other method.')
+       delete(h_waitbar)
+       varargout{1} = NaN;
+       return
+    end
+       
 
     k = borderI(1);
     r = k; % start point in the rank order vector
-- 
GitLab