Assignin table to the workspace and order of execution.

2 vues (au cours des 30 derniers jours)
Davin
Davin le 4 Sep 2014
Commenté : Davin le 15 Sep 2014
Hello,
I have a question on this command assignin. I am coding to filter some monthly data into quarterly, during this process, I have created some intermediary tables, using assignin, but the last statement of my code, will horzcat a date column and a data column, bearing in mind that the i pushed out the date and data array with assignin on the base workspace. But when the code comes to the horzcat, the tables which are needed to do the horzcat are not created yet so i have an error as follows :
Undefined function or variable 'datesQ'.
Error in GlobalMacroGui>uipanel13_SelectionChangeFcn (line 722) test = horzcat(datesQ,dataQ)
Error in gui_mainfcn (line 96) feval(varargin{:});
Error in GlobalMacroGui (line 42) gui_mainfcn(gui_State, varargin{:});
Error in @(hObject,eventdata)GlobalMacroGui('uipanel13_SelectionChangeFcn',get(hObject,'SelectedObject'),eventdata,guidata(get(hObject,'SelectedObject')))
Error in hgfeval (line 63) feval(fcn{1},varargin{:},fcn{2:end});
Error in uitools.uibuttongroup/childAddedCbk>manageButtons (line 79) hgfeval(cbk, source, evdata);
Error while evaluating uicontrol Callback
I do the get the creation of the tables only after this...
Is there another way to create these tables so that i can concatenate the 2 arrays. Or is there a way to wait until the creation of the table and then execute the cat...
I would much appreciate any help.
Thank u
D
  2 commentaires
Geoff Hayes
Geoff Hayes le 4 Sep 2014
Davin - you may have to post more of the code from your uipanel13_SelectionChangeFcn so that we can see how you are using assignin. Are you actually using this function to create the datesQ and dataQ local variables, and if so, why? What is the reason for assigning these variables to the base workspace? Since you are using a GUI, there are alternatives to share user-defined data between callbacks, namely guidata to set and retrieve data within the GUI.
Davin
Davin le 15 Sep 2014
Thanks Geoff and sorry for my late response. I managed to solve the issue with the use of guidata.

Connectez-vous pour commenter.

Réponses (0)

Catégories

En savoir plus sur Debugging and Analysis dans Help Center et File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by