From bd6d4d37ddd9c417774975528b58961bb2ebceaa Mon Sep 17 00:00:00 2001
From: Olivier Sauter <Olivier.Sauter@epfl.ch>
Date: Mon, 11 Jan 2021 14:12:53 +0100
Subject: [PATCH] fix call to h98y2 in case not filled in

---
 matlab/TCV/tcv_requests_mapping.m | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/matlab/TCV/tcv_requests_mapping.m b/matlab/TCV/tcv_requests_mapping.m
index 8c03b952..354eac28 100644
--- a/matlab/TCV/tcv_requests_mapping.m
+++ b/matlab/TCV/tcv_requests_mapping.m
@@ -160,7 +160,7 @@ switch lower(data_request)
                     'gdat_tmp2=gdat_tcv(shot,params_eff);'...
                     'params_eff.data_request=''\tcv_shot::top.results.conf:h_scal'';' ...
                     'gdat_tmp3=gdat_tcv(shot,params_eff);ih98y2=5;' ...
-                    'gdat_tmp.data = gdat_tmp.data./gdat_tmp2.data .* gdat_tmp3.data(ih98y2,:)'';'];
+                    'ih98y2=5;if size(gdat_tmp3.data,1)>=ih98y2;gdat_tmp.data = gdat_tmp.data./gdat_tmp2.data .* gdat_tmp3.data(ih98y2,:)'';end;'];
 % $$$  case 'icds'
 % $$$   mapping.timedim = 1;
 % $$$   mapping.label = 'various driven current';
-- 
GitLab