필터 지우기
필터 지우기

Assignin table to the workspace and order of execution.

조회 수: 1 (최근 30일)
Davin
Davin 2014년 9월 4일
댓글: Davin 2014년 9월 15일
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
Geoff Hayes
Geoff Hayes 2014년 9월 4일
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 2014년 9월 15일
Thanks Geoff and sorry for my late response. I managed to solve the issue with the use of guidata.

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

Help CenterFile Exchange에서 Debugging and Analysis에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by