From ca429c97a66a29f44cefd6c4e595198d942ebc12 Mon Sep 17 00:00:00 2001
From: Jacques Grelet <jacques.grelet@ird.fr>
Date: Wed, 13 Jan 2010 13:00:09 +0000
Subject: [PATCH] add assign variables & attributes in base workspace

---
 tsg_io/readTsgDataNetCDF.m | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/tsg_io/readTsgDataNetCDF.m b/tsg_io/readTsgDataNetCDF.m
index eaf2f11..6c9930d 100644
--- a/tsg_io/readTsgDataNetCDF.m
+++ b/tsg_io/readTsgDataNetCDF.m
@@ -171,14 +171,22 @@ automaticQC( hMainFig )
     for key = keys(nc.VARIABLES)
       var = char(key);
       tsg.(var) = nc.VARIABLES.(var).data__;
+      
+      % assign variable in base workspace
+      % -------------------------------------------
+      assignin('base', var , tsg.(var));
     end
     
-    % loop over all gloabal attributes and get associated value in
+    % loop over all global attributes and get associated value in
     % tsg structure
     % -----------------------------------------------------------------
     for key = keys(nc.ATTRIBUTES)
       att = char(key);
       tsg.(att) = nc.ATTRIBUTES.(att).data__;
+      
+      % assign globals attributes in base workspace
+      % -------------------------------------------
+      assignin('base', att , tsg.(att));
     end
     
     % Save the data in the application GUI
-- 
GitLab